×

Discussion Board

Results 1 to 10 of 10

Hybrid View

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

    MH5 Show/Hide Infobubbles

    I'm using this code to show all info bubbles on map, but it's not showing any. They remain as markers.

    var pois = map.pois;
    for(var poi in pois)
    map.showInfoBubble(poi);


    Any ideas?

    Thanks
    Tom

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

    Re: MH5 Show/Hide Infobubbles

    Hi Tom,

    Either your array is empty or the poi data structure is incompatible. Do you have "name" property in pois?


    Leo

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

    Re: MH5 Show/Hide Infobubbles

    Hi Leo,

    The array is not empty and the "name" property is there. I noticed that it was complaining about a "listener", so after I added this to the map control, the showInfoBubble started to work:

    infoBubble: {
    content: ["title"],
    listeners: {
    click: function () {
    SelectedPlaceID = poi.data.tag.toString();
    $("#map_marker_popup" ).popup( "open" );
    }
    }
    },

    However, when I try to hide the infoBubble using the same code and markers, it complains with the message "cannot convert a null to object" (on line 357 of mh5.js)

    The code is now:

    var pois = window.map.pois;
    guide_obj.map_control.showMarkerNames = !guide_obj.map_control.showMarkerNames;
    for(i=0;i<pois.length;i++)
    {
    poi = pois[i];
    if(guide_obj.map_control.showMarkerNames == true)
    window.map.showInfoBubble(poi);
    else
    window.map.hideInfoBubble(poi);
    }

    The pois are created like this:

    var poi = map.createPoi(nokia.mh5.assetsPath + "img/categories/12.icon.mh5.basic.png", { longitude: Place.Longi, latitude: Place.Lat });
    poi.name = Place.Name;
    poi.tag = Place.ID;
    pois[j] = poi;
    j = j + 1;
    ...
    map.pois = pois;

    Thanks
    Tom
    Last edited by tomgiam; 2013-01-12 at 16:44.

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

    Re: MH5 Show/Hide Infobubbles

    Hi Tom,

    hideInfoBubble doesn't accept the poi but the infobubble you want to hide (please look at the documentation). You get all the shown infobubbles by accessing map.infoBubbles array. Every infoBubble object has "poi" property which is the reference to the actual poi.

    Leo

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: MH5 Show/Hide Infobubbles

    Hi,

    What parameters need to be passed to hideInfoBubble to close it? Looked over docs can not find the information needed.

    Thanks again!

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

    Re: MH5 Show/Hide Infobubbles

    To close it is easy, but I still can't figure out how to open it.
    This code will close all displayed infoBubbles:

    var infobs = window.map.infoBubbles;
    for(i=0;i<infobs.length;i++)
    window.map.hideInfoBubble(infobs[i]);

    When they are closed the window.map.infoBubbles array is empty so you can only see the pois, when I try:

    var pois= window.map.pois;
    for(i=0;i<pois.length;i++)
    window.map.showInfoBubble(pois[i]);

    it doesn't work.

    Tom

Similar Threads

  1. Hide and show Option Menu?
    By khanhcoc1210 in forum Symbian User Interface
    Replies: 1
    Last Post: 2012-03-25, 09:14
  2. Hide/Show My App and Getting Key Like #123...
    By ArvinShahidi in forum Symbian
    Replies: 16
    Last Post: 2009-07-15, 16:09
  3. Hide/Show CBA
    By m4a127 in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-12-04, 10:47
  4. ALLOC : Hide/Show Tabs
    By Kavit Patel in forum Symbian
    Replies: 1
    Last Post: 2008-06-30, 09:36
  5. able to hide buttons - not able to show them again
    By sunny_singh in forum Symbian
    Replies: 0
    Last Post: 2005-11-24, 10:06

Posting Permissions

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