How to add multiple bubbles to maps using jHERE jQuery

I am trying to add some bubbles to maps using jHERE jQuery ( http://jhere.net/ ). I've tried using this code:

$(window).on('load', function() {
$('#mapContainer').jHERE({zoom: 5});
  $('#mapContainer').jHERE('bubble', [52.500556, 13.398889], {closable: false, content: 'Abc: 100'});
  $('#mapContainer').jHERE('bubble', [51.500556, 13.398889], {closable: false, content: 'Def: 100'});
});

      

maps

But only one / last bubble is generated on maps. How do I add multiple bubbles to cards?

Thank!

+3


source to share


1 answer


By default, the autoClose

InfoBubbles component option is set to true

(only one InfoBubble can be open at a time).

You must set this option to false

.

Add this after creating the map, but before creating the InfoBubbles:



  $('#mapContainer').jHERE('originalMap', 
                           function(map,here){
                            var b=new here.map.component.InfoBubbles();
                            map.addComponent(b);
                            b.options.set("autoClose", false);});

      

Demo: http://bin.jhere.net/c0b57694d70d50840528

+1


source







All Articles