0

Using Mapbox instead of Google, I'm building up a menu in the map that shows tabbed infowindow on every marker. The problem is that no matter which marker I'm on, the infowindow is always the same (from only one of the markers), as if it doesn't read the variable content var p = marker.feature.properties;

Anyone please have a look at this demo Thank you

[the system wont allow me to reply to the reply I got, so here's my reply:] Thanks for the link. It's a different approach. The menu is missing and I can't really integrate the two scripts:

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Instead of adding "SOLVED" to the title, post your own Answer and explain how it was solved. –  Jul 13 '14 at 11:15
  • It's right there, at the bottom of the comments. –  Jul 14 '14 at 18:25

1 Answers1

0

This was an error in that particular example: see the fixed version that correctly binds the right tooltip to the right marker.

tmcw
  • 11,536
  • 3
  • 36
  • 45
  • This "fixed version" is not working. I have variables not catching up. The tabs show only the last in order of the fetured marker in the GeoJSON file. Any solution to why this easy script is not working? –  Jun 21 '14 at 19:08
  • The version I linked under the text 'fixed version', works. Are you sure you've updated your code? – tmcw Jun 21 '14 at 19:41
  • it doesn't work in the sense that any information in the marker's "description" is output as a tab. See the 2 different markers on this test](http://studiocasa85.com/geo/tabbed2.html) –  Jun 22 '14 at 12:39
  • That's a different concern: see the code: `for (var key in p) {` this will create a tab for each property. If you want to create tabs for subsets of properties, you can change that with basic `if` statements. – tmcw Jun 23 '14 at 13:33
  • I have actually solved the problem. There was an error in 'myLayer.bindPopup(content)' that should be changed to `marker.bindPopup(content)`. Thank your for your attention. –  Jun 24 '14 at 19:14