none
Pushpin htmlContent and BingTheme RRS feed

  • Question

  • I'm excited about the new htmlContent property in the Pushpin, but it doesn't work with the Themes module.  How do I use the Themes module and the htmlContent?

    // Try this in the Interactive SDK
    Microsoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme', { callback: function() 
    {
        map = new Microsoft.Maps.Map(document.getElementById('SDKmap'), 
        { 
             credentials: 'Your Bing Maps Key', 
             theme: new Microsoft.Maps.Themes.BingTheme() 
        }); 
    
    // Working event with HTML
    map.entities.clear(); 
    
    var pushpinOptions = {width: null, height: null, htmlContent: "<div style='font-size:12px;font-weight:bold;border:solid 2px;background-color:LightBlue;width:100px;'>Custom Pushpin</div>"}; 
    
    var pushpin= new Microsoft.Maps.Pushpin(map.getCenter(), pushpinOptions); 
    
    pushpinOver = Microsoft.Maps.Events.addHandler(pushpin, 'click', function () { alert('heoll'); } );
    
    map.entities.push(pushpin);
    }});

    -=Dan=-

    Tuesday, October 2, 2012 12:27 AM

Answers

  • The ThemeModule does not support custom pushpins. That includes both the icon and htmlContent properties.

    http://rbrundritt.wordpress.com

    Tuesday, October 2, 2012 8:27 AM