×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    13

    Map markers not always shown when max zoomed out

    I have a map where I am displaying 10 map markers that are spread across the entire globe.

    I add the map markers into a container, then zoom to a bounding box for the map markers. (I have to use "zoomTo" because it may not always be a full world map required).

    Anyway, the world map seems to be centred (left to right) on the longitude cutting through Australia. All of the map markers seem to be to the left of this centre with none near America (shown on the right hand side). However, if I drag the map left to right to show America again (coming in from the left hand side) then some map markers appear that weren't shown originally. I can't show any screenshots because the site is still in development but the [random] lat,lngs that I am currently using that display this issue for me are:

    39.5474334311452, -130.693925892152
    50.9953824449402, 46.5544276283572
    9.72457308969499, 149.549985257818
    51.2199233543651, 71.2974683605973
    35.7527858110784, 78.5887279542826
    35.7527858110784, 78.5887279542826
    9.72457308969499, 149.549985257818
    51.2199233543651, 71.2974683605973
    41.1658774331193, 74.4944569477367
    23.4267190129803, -161.560225726058

    This isn't the only combination of worldwide map markers that have caused this issue so any guidance as to whether this is a bug or my own fault would be appreciated.

    The markers may actually be on the map tiles images that have been loaded but they are not actually displayed on the tiles within my map div.

    Thanks

    Col

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Map markers not always shown when max zoomed out

    For me that would quickly thinking sound like a bug. Did not check it in action, but if you have an area shown with full zoom and some icons in that area are not shown even though they are in the visible area, but moving the map makes them visible.

    Basically could be that there is programming error from you, but at least it sounds enough like bug, thus I would basically make a minimal implementation to illustrate the problem and then make a bug report out of it.

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    13

    Re: Map markers not always shown when max zoomed out

    It might apply at lower zoom levels (ie not just when fully zoomed out).

    Here's a quick mockup of the issue: http://jsfiddle.net/Zjv5g/

    As you can see the markers aren't always shown in the div even though they should be because I have used the zoomTo. If you drag the map they come into view because they were hidden. Its like the markers are on a map tile but that particular map tile isn't in view at the time.

  4. #4
    Regular Contributor
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    289

    Re: Map markers not always shown when max zoomed out

    It appears to be because the markers are spread out such that the smallest bounding box crosses the 180 degree anti-meridian. The markers in the Western Hemisphere are being added to the first American continent if the bounding box crosses 180, but the display is shown the second American continent to the right.

    A work around for your data set would be to add the keepCenter parameter to ensure the map remains centred over the Gulf of Guinea,
    map.zoomTo(markersBoundingBox, markersBoundingBox.isCDB);

    Another alternative would be to use the DOM rather than the Canvas rendering:

    <script src="http://api.maps.nokia.com/2.1.0/jsl.js?kml=auto&map=js-p2d-dom" type="text/javascript"></script>


    The same problem exists at higher zooms when the markers cross the date line, as these three markers in Fiji will demonstrate.

    addMarker(1, "Hello 1", [-18,178.333]);
    addMarker(2, "Hello 2", [-18.5,180]);
    addMarker(3, "Hello 3", [-18.5,-178.333]);
    Last edited by jasfox; 2012-02-21 at 11:24. Reason: Added DOM workaround

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Map markers not always shown when max zoomed out

    Jason, can you also add a bug report into the JIRA for this behavior.

  6. #6
    Registered User
    Join Date
    Dec 2011
    Posts
    13

    Re: Map markers not always shown when max zoomed out

    Thanks Jason, the DOM rendering option worked.

    Do the maps normally use canvas rendering where browsers support it and DOM for those that don't and with this change my page will be using the slower DOM rendering for all browsers?

  7. #7
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,098

    Re: Map markers not always shown when max zoomed out

    Hi there amnesia7,

    Yes if Canvas is available we switch the map to use Canvas else such as in the case of Internet Explorer 7 & 8 will revert back to DOM engine.
    You can manually specify which technology you want to use by specifying a URL parameter whilst loading the Maps API

    Default: Canvas used if available else DOM

    <script src="http://api.maps.nokia.com/2.1.1/jsl.js" type="text/javascript" charset="utf-8"/>


    Force use of DOM map

    <script src="http://api.maps.nokia.com/2.1.1/jsl.js?map=js-p2d-dom" type="text/javascript" charset="utf-8"/>

    Force use of Canvas map

    <script src="http://api.maps.nokia.com/2.1.1/jsl.js?map=js-p2d-dom" type="text/javascript" charset="utf-8"/>

    Keep in mind that if you use the force Canvas/DOM override things might break e.g.

    Trying to load Canvas on Internet Explorer 7 and 8 will not work and trying to load DOM on mobile device may result in poor performance.

    Best Regards,
    Marko
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  8. #8
    Registered User
    Join Date
    Dec 2011
    Posts
    13

    Re: Map markers not always shown when max zoomed out

    In that case I hope it doesn't take too long for the bug to be corrected so that I can switch back to the auto option rather than forcing DOM for all users.

    I assume the bug report has now been filed. Is there somewhere I can subscribe to the bug report so I know when it has been corrected?

    PS I think your "force canvas" script is incorrect since it currently shows the same script as for forcing DOM.

  9. #9
    Registered User
    Join Date
    Dec 2011
    Posts
    13

    Re: Map markers not always shown when max zoomed out

    I've just been having a check to see if this has been sorted yet and as this demo shows, it doesn't appear to have been. Is there a reason?

    http://jsfiddle.net/amnesia7/9YUVe/embedded/result/

    You'll need to zoom out quite a few times to actually see the markers.

    Col

Similar Threads

  1. Trying to geocode and add markers from array of addresses
    By MGunner in forum General Development Questions
    Replies: 4
    Last Post: 2011-11-23, 16:02
  2. Google Map URL J2ME markers
    By v2sms in forum Mobile Java General
    Replies: 1
    Last Post: 2010-02-15, 13:04
  3. Replies: 0
    Last Post: 2010-02-15, 11:32
  4. Scrolling the Zoomed Image
    By rajasg in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-08-13, 09:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×