×

Discussion Board

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

    Customized MarkerCluster

    Hi,

    I am new to Nokia maps api. I am trying to use markerCluster functionality for my mapping solution. I need to use custom marker icons both for cluster markers and individual markers. I need to be able to show labels and circles around the markers when individual markers come to display and hide them when they get into a cluster. I have an array of markers as opposed to datapoints, an array of labels, and an array of circles objects to be passed to cluster object. I have done this using google maps api and now I need to do it using Nokia maps api. I thought I'd better use the alternative to google maps clustering javascript file (markerclusterer.js) rather than the clusterprovider just to have the option to customize icons. I managed to show custom icons and labels to individual markers but not cluster markers. Also the Zoomchange event wasn't working so I called the attach function at the end, but this now has caused an error to appear that reads: localhost is not responding, script is too long!

    Can anyone put me into right direction please.
    Should I be using markerclusterer.js or clusterprovider? All I require is to customize my icons both cluster and individuals as well as show/hide some other objects (labels/circles) on individual markers.

    Any help is much appreciated

  2. #2
    Super Contributor
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,578

    Re: Customized MarkerCluster

    Hi Liela - I've moved your thread - this is the best group for maps on JavaScript questions on this site (though support is also offered on StackOveflow). You might want to search here in case your question has already been answered.

  3. #3
    Nokia Developer Moderator
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    288

    Re: Customized MarkerCluster

    Quote Originally Posted by LeilaMGoharian View Post
    this now has caused an error to appear that reads: localhost is not responding, script is too long!
    This error is to do with the way that the browser interprets asynchronous JavaScript - older versions of Internet Explorer are notorious for this. Potentially, if you are using the markerclusterer.js then improving the performance of the library can be done by hacking away at the underlying code - but as an ad-hoc solution the markerclusterer.js comes with no guarantee (see below) and changes should be made at your own risk.


    Quote Originally Posted by LeilaMGoharian View Post
    javascript file (markerclusterer.js) rather than the clusterprovider just to have the option to customize icons. ...

    Should I be using markerclusterer.js or clusterprovider? All I require is to customize my icons both cluster and individuals as well as show/hide some other objects (labels/circles) on individual markers. .... o show labels and circles around the markers
    clusterprovider is the officially supported solution, and therefore should be preferred. The alternative markerclusterer.js library was an ad-hoc solution made available prior to clustering being integrated into the API and of course since the full source code is available under Apache License you would be free to look at and alter the underlying code as necessary (whilst maintaining the attribution). However for a basic clustering example you will not need to do this anyway.

    Both solutions support customization of the data, if you look at the thread here, you will see that getClusterPresentation() and getNoisePresentation() - are functions that style the data from the cluster. If you use a MapMarker rather than a StandardMarker you will be able to change the marker to the format you need. If you want text on a Marker try something like this

Similar Threads

  1. Customized Menu Bar
    By v-6 in forum Symbian C++
    Replies: 1
    Last Post: 2011-04-06, 05:48
  2. Customized Lib
    By zgcrzg in forum Symbian C++
    Replies: 1
    Last Post: 2011-02-23, 12:17
  3. Customized UI
    By samoylik in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-01, 11:57

Posting Permissions

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