×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2012
    Location
    Mexico
    Posts
    7

    Question Is there any function to load layers of map objects?

    Hi, now I have my data base of points of interes, wich contains nearby 40 000 points. I need to show all of this points in the map for a logistic aplication, Is there any function to load layers of map objects?

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

    Re: Is there any function to load layers of map objects?

    40 000 markers is an awfully large number to display on a single map. You are going to have to reduce this number somehow. The obvious way to do this would be to use a clustering library.

    I've attached an example which will cluster client side, for you to look at, feel free to modify as you see fit:
    (within license) http://www.developer.nokia.com/Commu...terExample.zip

    This works reasonably well for hundreds of markers, but is too slow for thousands. It starts to trigger "slow Script" dialogs and so on. For even more markers you are going to have to cluster server side.

    The key to implementing clustering is to add a mapviewchangeend Event Listener to the display.

    Code:
    	
    var defaultHandler = function (evt) {     
              clusterer.cluster( display.getViewBounds());};
    
    display.addListener("mapviewchangeend",defaultHandler);
    The client side clusterer uses this trigger to divide the markers on the map into those within the ViewBounds and those outside it. The markers left within the ViewBounds are then clustered. Obviously the code has to trawl through the markers at least once, so the response time will increase with more markers. I reckon it would be quicker to make a request to your server at this point and let the server retrieve the clustered markers within the viewport only

    There is an example on how to request and retrieve marker data here:
    http://www.developer.nokia.com/Commu..._from_XML_data

    More details on clustering will be added here:
    http://www.developer.nokia.com/Commu...er_map_markers
    Last edited by jasfox; 2012-06-14 at 11:38. Reason: update link.

  3. #3
    Registered User
    Join Date
    Feb 2012
    Location
    Mexico
    Posts
    7

    Re: Is there any function to load layers of map objects?

    Thanks jasfox, your response was very useful.

    I have another doubt.

    You have planned some functionality to store layers on the server?, for example if I need a group of markers is always visible on map load.

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

    Re: Is there any function to load layers of map objects?

    If you are looking to pass control of the image display to the server (which you will need to do for an extremely large data set, you are going to have implement your own map tiler.

    The Nokia Maps API offers maps using the Normalised Mercator Projection. This covers the globe from 85.0511°N to 85.0511°S and across all longitudes. At the lowest zoom this is contained in an individual map tile. The number of map tiles displayed doubles on each axis as the zoom level increases, therefore it is possible to obtain a map tile image at any location on the globe (apart from the poles) at any zoom where:

    X goes from 0 (left edge is 180°W) to 2^zoom -1 (right edge is 180 °E)
    Y goes from 0 (top edge is 85.0511°N) to 2^zoom -1 (bottom edge is 85.0511 °S)

    Where the longitude λ and latitude φ in radians maps onto x and y as follows:

    {λ, φ} -> [-1, 1] x [-1, 1]

    x = λ / π

    y = ln(tan(π/4 + φ/2)) / π

    I've created a library to do the mathematics on the client side, and request an appropriate map tile:
    http://www.developer.nokia.com/Commu...custom_overlay

    This can be plugged in to any existing map tiler. The part which remains for this to be useful, is to interpret the request server side and for you to return an image (preferable 256x256 pixels) which corresponds to the region requested. If you return images in the .png format, transparency will be respected and the Nokia Map will show through underneath.

  5. #5
    Registered User
    Join Date
    Feb 2012
    Location
    Mexico
    Posts
    7

    Re: Is there any function to load layers of map objects?

    Thanks, very useful.

Similar Threads

  1. How to load objects through VBO method in Symbian^3?
    By Atul Prakash in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2011-07-20, 08:47
  2. Replies: 7
    Last Post: 2007-02-18, 18:25
  3. Replies: 4
    Last Post: 2006-11-10, 13:15
  4. how to load 3d objects
    By sym_coder in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-06-06, 10:52

Posting Permissions

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