×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    2

    Exclamation Marker Clustering Issue

    Hello,

    I am converting an application (forced to convert :) ) which has been using google maps to nokia. I cant seem to understand the logic how nokia here api clustering works. Couple of screenshot from the API explorer bellow link.

    http://gedpov.com/clustering-zooming-out.png

    I have screenshot for four zoom levels showing what happens to the clusters and how they randomly shift to one part of the world. It looks like one cluster sucks in whole of the europe. Now this dosent seem OK at all not really usable.

    Another link bellow shows up a marker on top of a cluster which is also very strange.

    http://gedpov.com/clustering-marker-on-top.png


    Tried to use MarkerClusterer library written by "Xiaoxi Wu" but that is also a bit weird when it comes to displaying clusters and how they are positioned on the map. As i understand nokia clustering works out the distance between markers with pixels? maybe I am wrong. See another link bellow

    http://gedpov.com/mapclustering.png

    I have been using "MarkerClustererPlus" with google which works great. I dont really want to spend time and convert the whole library to work with nokia.

    Anyone experienced anything similar ? any help appreciated.

    Ged

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

    Re: Marker Clustering Issue

    The "noise point over a cluster" example looks like a bug to me. It appears that the noise point is initially outside of the view port, and it doesn't join a cluster when the map is moved. This issue doesn't occur if the map is viewed full screen or if the zoom level starts at one and is zoomed in. If necessary you can force a refresh with a listener:

    Code:
    map.addListener("mapviewchangeend", function(){clusterProvider.invalidate (); clusterProvider.cluster (); });
    Different algorithms result in different clusters indicating the same spread of data You can see in the attached image that the Google algorithm shows 60 airports just off the tip of South west England, whereas the HERE algorithm shows the same cluster near to London. Which algorithm works "better" is an entirely subjective decision, as clusters are by their nature only an approximation of the data
    google-cluster-vs-here-cluster.jpg

    You can try altering the eps value to obtain broader to narrower clusters . The "best" approximation of a few "tidy" clusters relies on markers being packed tightly together, with large gaps in between. I guess the eps chosen and data set used means that initial low zoom cluster is Europe based, but a high eps means the density of airports in India is being added to the zoomed out value. resulting in a huge cluster over Saudi Arabia rather than one in Europe and one in India. I would suggest a lower eps .


    There is a port of the Xiaoxi Wu MarkerClusterer available here. If you look at the addMarker method:

    Code:
     this.addMarker = function (marker) {
        if (center_ === null) {
          center_ = marker.marker.coordinate;
        }
        markers_.push(marker);
      };
    You will see that the center_ is based on the location of the first coordinate in a cluster - I guess this is the reason why the cluster doesn't center where you expect it. It is just bad luck which marker is selected first. I assume this decision was made in order to mimimise calculations.

    I suspect there is a line missing from the code at line 570:

    After:
    Code:
    clusterMarker_ = new nokia.maps.map.Marker(center_ , {icon: markerIcon});
    The anchor needs to be set:
    Code:
    clusterMarker_.set("anchor", new nokia.maps.util.Point(25, 25));
    Otherwise the icon cluster point will be at the top left of the SVG square, not the centre of the circle and will be out by 25 pixels - this is obviously more serious at lower zoom levels.
    Last edited by jasfox; 2013-09-04 at 20:21.

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    2

    Re: Marker Clustering Issue

    Thanks for your reply.

    The nokia api clustering is still doing the same thing even with eps set as low as 1. Its still shifting and clustering everything to Saudi Arabia. I think i will tweak the Xiaoxi Wu script to suit my needs. Thanks for pointing out the missing anchor tag.

    Ged

Similar Threads

  1. clustering.ITheme and clustering.MarkerTheme for ClusterProvider
    By upixsoul in forum [Archived] Maps API for Javascript
    Replies: 5
    Last Post: 2012-10-16, 16:07
  2. Issue with display map marker in real device
    By floorbrain in forum Symbian
    Replies: 4
    Last Post: 2012-05-09, 17:14
  3. Clustering on distance matrix
    By mrjayaram in forum Mobile Java General
    Replies: 0
    Last Post: 2010-07-21, 15:43
  4. Clustering on data matrix
    By mrjayaram in forum Mobile Java General
    Replies: 0
    Last Post: 2010-07-14, 12:42

Posting Permissions

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