javascript - Programmatically opening a popup in a Mapbox map -


i have mapbox map @ http://bei.dev.bclcmaps.com/ has popups open when clicking marker.

my problem need way set default popup open on page load based on value in url. can latitude , longitude or other value, whatever's easiest.

i have banged on while , seems either need to:

  1. programmatically open popup via mapbox js api, can't figure out since seems popups auto-generated on fly when marker clicked, or
  2. programmatically click marker open popup. can't figure out because 1) don't know how find marker lat/lon , 2) can't figure out how click marker js.

i've tried this:

map.gridlayer.fire('click', {latlng: l.latlng(28.04419, -81.947864)}); 

which closes existing open popups doesn't seem open own. i've tried digging through map , leaflet objects see if location/marker data stored in there , can't find besides tiles.

most of examples can find seem using geojson i'm not using makes things difficult.

any advice?

map.fireevent('click', {latlng: l.latlng(28.04419, -81.947864)}); 

you close - 'click' event needs latlng object named 'latlng' (lower case)


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -