none
Bing Map 7.0 API Map in Legacy Frameset Web Application RRS feed

  • Question

  • I have a legacy web application that we are updating to use the new maps API and everything except polylines are working fine. I have plotted several points on my map and they are plotted in the correct location for their lat/long values. However, when I try to add a polyline between 2 of them, using the exact lat/long values of the 2 points, it is plotted off to the right of where it should be and moves further away or closer as I zoom in and out. I have tried this same exercise in the interactive sdk and everything works as expected, so I'm wondering if any testing was done with a frameset website with and older docttype, etc. One thing to note is that for the page the map is on, I made a temporary edit to update the doctype to that specified in the documentation, but to no avail.

    Here are some details for my environment:

    1. The frameset consists of 3 frames (top, middle & bottom).

    2. We are using the following meta tag with this site due to some problems with how modern versions of IE render some of our really old code: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />.

    3. The current doctype is HTML 4.0 Transitional. However, I did swap that out temporarily for the XHTML 1.0 Transitional doctype to see if that was the issue, but it did not help. I also made sure to add the meta tag for the utf-8 charset to see if that would help.

    4. I am testing in IE 10 on Windows 7, with all the latest updates.

    5. This is an asp.net application currently running on v.4 of the framework.

    Thanks!

    Thursday, May 23, 2013 7:30 PM

Answers

  • After taking a week off, I got back to this and resolved the issue. It appears to be an issue with the <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> meta tag.

    I resolved this for our legacy application by creating a new master page that does not include this meta tag and the lines were then plotted correctly. In our case, this page did not use any of the features of the original master page because it was designed to be full screen, so it was easy to create a simpler master page for the map.

    I would not call this a bug in the API, just something to watch out for when trying to update a legacy application to use the new API.

    • Marked as answer by farroutt3fan Tuesday, June 4, 2013 6:31 PM
    Tuesday, June 4, 2013 6:31 PM

All replies

  • Would it be possible to send sample code or email me the project for testing (ricky_brundritt at Hotmail dot com)?

    Another quick and simple thing to check, does your map div have a height, width and position value specified in the styles?


    http://rbrundritt.wordpress.com

    Thursday, May 23, 2013 7:34 PM
  • It would be very difficult to send or email sample code due to the complexity of the layout and projects involved in the solution, but what I will try to do is create a much simpler frameset layout that mimic what we have and see what happens with that. If I can duplicate it that way, I'll post that, probably tomorrow.

    I do have height, width and position on the map div, though it does change when the user resizes the browser.

    Thanks!

    Thursday, May 23, 2013 8:51 PM
  • Just a quick follow-up to say that it does not appear to be an issue with the frameset or the legacy doctypes, etc. that we are using. I created a simple frameset that duplicated much of the layout of our application and the pushpins and the polyline between them plotted as expected.

    When I find the cause of the problem in our much more complex page, I'll post an answer.

    Friday, May 24, 2013 12:47 PM
  • I just found a difference in the way the polyline is being drawn on the map in the HTML only frameset proof-of-concept I created vs. the ASP.Net web application (uses a similar frameset) that is currently not drawing the line in the correct location.

    In the ASP.Net application where I have the problem, the polyline is being generated with the following HTML (copied from IE 10 dev tools):

    <div class="MicrosoftMapDrawing" style="left: -552px; top: -275px; width: 1105px; height: 550px; ;" harmonyContext="[object Object]"><shape style="width: 1105px; height: 550px; ; behavior: url(#default#VML);" cm1008_er_der="[object Object]"><stroke style="behavior: url(#default#VML);"/><fill style="behavior: url(#default#VML);"/>

    But in the HTML only frameset, it is being generated with the following HTML:

    <div class="MicrosoftMapDrawing" style="left: -549.5px; top: -276.5px; width: 1099px; height: 553px; ;"><svg width="100%" height="100%"><path style="pointer-events: visiblePainted;" fill="none" fill-opacity="1" fill-rule="evenodd" stroke="#ff0000" stroke-dasharray="none" stroke-linecap="butt" stroke-opacity="1" stroke-width="3" d="M 550 277 L 501 475"/>

    Why does it draw a <shape> object in ASP.Net, but an <svg) object in a basic HTML page? Could this be the cause of my problem?

    Friday, May 24, 2013 2:14 PM
  • Sorry for so many updates, but I have just completed a POC in ASP.Net of my HTML POC and it does not appear that ASP.Net or framesets or older doctypes are the issue. In ASP.Net, the polylines are drawn using different objects, but they do successfully plot correctly, except in my legacy application page.

    So, back to the drawing board for now to see if I can find out what is throwing off the position of the polyline.

    Friday, May 24, 2013 4:39 PM
  • After taking a week off, I got back to this and resolved the issue. It appears to be an issue with the <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> meta tag.

    I resolved this for our legacy application by creating a new master page that does not include this meta tag and the lines were then plotted correctly. In our case, this page did not use any of the features of the original master page because it was designed to be full screen, so it was easy to create a simpler master page for the map.

    I would not call this a bug in the API, just something to watch out for when trying to update a legacy application to use the new API.

    • Marked as answer by farroutt3fan Tuesday, June 4, 2013 6:31 PM
    Tuesday, June 4, 2013 6:31 PM