×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    31

    How to change categoryIcon of existing poi

    What is the best way to change the image for the categoryIcon of a poi already on the map?

    I tried changing the image of an existing poi by using:

    poi.categoryIcon = img;

    but that didn't work.

    the only way I could do it was to do that and then put all of the pois in the map again:

    map.pois = pois;

    but even that only worked with one image and then I could not change a second poi to a different image.


    Thanks
    Tom

  2. #2
    Registered User
    Join Date
    Dec 2012
    Posts
    10

    Re: How to change categoryIcon of existing poi

    I guess you could take a look at the customization zip file in the api. More specifically "How to customize.pdf". It has an entire category on how to customize markers/icons/elements.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    31

    Re: How to change categoryIcon of existing poi

    I'm not trying to customize it. I'm just trying to change the marker image from the one I loaded initially to a new one. It should be one line of code i.e.

    poi.categoryIcon = new_img;

    but it's not working for me.

    Thanks
    Tom

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2012
    Posts
    65

    Re: How to change categoryIcon of existing poi

    The "categoryIcon" property is used only if you call createPoi method. To change the image you have to reset the image property of the poi:
    var image = new Image();
    image.onload = function() {
    myMap.pois[0].image = image;
    }
    image.src = "myUrl.png";


    Leo

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    31

    Re: How to change categoryIcon of existing poi

    That works!

    Thanks

Similar Threads

  1. Hiding the existing UI
    By gauravwable in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2011-10-11, 14:59
  2. Replies: 1
    Last Post: 2009-06-09, 12:04
  3. how can i change in existing user interface of N93?
    By mitesh_thakkar in forum Symbian User Interface
    Replies: 13
    Last Post: 2007-11-20, 06:38

Posting Permissions

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