none
Bing Maps v8 API -How do I change the color of the pushpin dynamically? RRS feed

  • Question

  • I have a requirement to change the color of pushpins dynamically.

    Below link works for V7, Section: A more colorful pushpin

    https://rbrundritt.wordpress.com/2013/04/10/html5-canvas-pushpins-in-javascript/

    Sample code available at V8 Canvas pushpin for Arrow mark

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#createPushpinFromCanvas+TS

    Please share the sample code for colorful pushpin that support Bing maps V8.









    Thursday, May 19, 2016 9:50 AM

Answers

  • If you want to change the color of the built in pushpin in V8, simply use the new color pushpin option:

    var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), {color: 'blue'});
    This is new in the V8 control (about 2 weeks old). The documentation for V8 is only about 2/3rds complete, this will be added in due time, we are currently focusing on getting V8 in a position to take it out of preview and have it fully released which is planned for the end of June. As such adding new documentation is a lower priority at the moment. We also have a lot more custom pushpin samples coming soon as well.

    [Blog] [twitter] [LinkedIn]


    Thursday, May 19, 2016 4:08 PM