Draw bing map pushpin using custom shape & click event should only work for shaped pushpin

耗尽温柔 提交于 2020-01-25 09:40:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!