none
Embedded Map - Doesn't always load, sometimes black space. RRS feed

  • Question

  • Hi, 

    I'm new to the world of Bing Maps, previously I've always used Google Maps but I thought I'd give the underdog a try!

    Unfortunately I'm finding it rather hit and miss when it comes to the map loading. I appreciate that every site is different and I might have some added complications due to using a Wordpress plug-in to display the map; however I was wondering if anyone knew of some quick things to check that might stop a map loading properly every time?

    http://www.bisphamroundabout.co.uk 

    When viewing the source of the rendered page I see:

    <script type="text/javascript">map = new VEMap('bingMapsForWordpress1');map.SetCredentials("Ao0xlZUdDJy7_B-uxN3aCQnMkGItg_V3q59FEBRTxQ6IwR0vIWXbtmat4zkD9CgK");map.LoadMap(new VELatLong(53.851585, -3.040876, 0, VEAltitudeMode.RelativeToGround), 15, VEMapStyle.Birdseye, false, VEMapMode.Mode2D, true, 1);var layer = new VEShapeLayer();var pin = new VEShape(VEShapeType.Pushpin,map.GetCenter());pin.SetTitle("53.851585%3B%20-3.040876");layer.AddShape(pin);map.AddShapeLayer(layer);map.SetZoomLevel(15);</script>


    Many thanks for any pointers, I'd hate to give up on Bing Maps already!

    Tuesday, November 20, 2012 4:39 PM

Answers

  • Hi there,

    Since it looks like you really just want to embed a map of a particular feature in your page, you might be better off using the REST imagery service rather than the AJAX control. In other words, add an <img> to your page with a src that points to something like this:

    http://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels/53.851585,-3.040876/17?mapSize=640,480&format=PNG&key=Ao0xlZUdDJy7_... rest of your Bing Maps key here...

    That will embed a static map image in your page as follows:


    twitter: @alastaira blog: http://alastaira.wordpress.com/ | Pro Spatial with SQL Server 2012


    Tuesday, November 20, 2012 5:36 PM
    Moderator

All replies

  • Taking a quick look at your site I see you are using an old version of Bing Maps that is very out of date. I recommend using the latest version: http://msdn.microsoft.com/en-us/library/gg427610.aspx

    http://rbrundritt.wordpress.com

    Tuesday, November 20, 2012 5:32 PM
  • Hi there,

    Since it looks like you really just want to embed a map of a particular feature in your page, you might be better off using the REST imagery service rather than the AJAX control. In other words, add an <img> to your page with a src that points to something like this:

    http://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels/53.851585,-3.040876/17?mapSize=640,480&format=PNG&key=Ao0xlZUdDJy7_... rest of your Bing Maps key here...

    That will embed a static map image in your page as follows:


    twitter: @alastaira blog: http://alastaira.wordpress.com/ | Pro Spatial with SQL Server 2012


    Tuesday, November 20, 2012 5:36 PM
    Moderator
  • Many thanks for replying and you thank you for your suggestion.  

    I can understand why you thought I might be able to use a static map but unfortunately I will require the tool overlays to enable visitors (both leaner drivers and instructors) to be able to zoom, pan and rotate the map. 

    Thanks again for your answer though!
    Tuesday, November 20, 2012 9:55 PM