问题
Feature Overview
I am using Bing Map V8. As per the requirement, we need to create custom pushpin (ref. Custom Pushpin) which contains three different html elements. E.g. Canvas, Image & Label. That pushpin will be looks like below,
In this pushpin, all three elements are being set dynamically on run time. Like, Canvas radius, Pushpin Name font style (color, size), etc.. properties are different per pushpin.
This feature we achieved by merging these three elements into the canvas and then by converting canvas using toDataURL() method. Ref. Create pushpin from Canvas
But in this way pushpin is one image element. And when we applied pushpin click event, it's considering whole image (including white-space) not only drawn shape.
Also as per pushpin options, we can set roundClickableArea = true
to reduce white space clickable area. But then also there is some more part on which click is working.
Question
We want to add pushpin in some particular shapes (shape manner) so that pushpin click applies on the drawn part only.
It would be appreciated if is there any other way to achieve this feature (dynamic pushpin + only click on pushpin area).
来源:https://stackoverflow.com/questions/59358093/draw-bing-map-pushpin-using-custom-shape-click-event-should-only-work-for-shap