maps - Open a popover with by ID - Mapbox -


in mapbox creating overlays using following code within map creation function - http://jsfiddle.net/shanejones/3ajankv9/

i need work out way open popover it's id in separate function.

using post here have modified following example should open layer id 1.

function next(next_id){      map.featurelayer.eachlayer(function(marker) {          if (marker.feature.properties.id == marker_id) {             marker.openpopup();         }      });  } 

but give me undefined error know i'm going wrong here?

edit - show error when run above function console.

enter image description here

thanks

i ran problem in past. ended doing this, it's not best solution may out.

 map.featurelayer.eachlayer(function(marker) {     if (marker.feature.properties.id == marker_id) {           marker.fireevent('click', {                 latlng: {                     lat: marker._latlng.lat,                     lng: marker._latlng.lng                 }           });     } }); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -