javascript - Mapbox GeoJSON loaded via local URL: icons not showing popup properties -


In my web site, I am using a mapbox map to load icons from such URLs such as:

  / * myMapbox.js * / map = L.mapbox.map ("map", "somemap.hhlj93e3"). Setview ([47.60, -122.33], 13); ... .someAjaxCall {allMyIcons = L.mapbox.featureLayer () .loadURL ("/ updated ecommons"); AllMyIcons.addTo (map); } The icons loaded through  

/ updatedIcons are visible, but they were not clickable. I solved the problem of clicking on this, however, even when I click on the icon, the properties for each feature (icon) received through / updatedIcons calls do not show as a popup (When I click on the icon) Note that the mouse created for the somemap on the Mapcode site is shown on the map, and they are clickable, and a popup looks happily for those the same map At . Here's a sample of my GeoJSON loaded through

/ updatedIcons :

  [{"type": "feature", " Geometry ": {" type ":" point "," coordinate ": [-77.03, 38.90]}," property ": {" picture ":" https://upload.wikimedia.org/wikipedia/commons/thumb/ "Feature", "geometry": {"type": "point", "coordinate": [-87.63, 41.88], "e-mail", "echo" }, "Properties": {"image": "https: / /upload.wikimedia.org/wikipedia/commons/thumb/8/82/Chicago_sunrise_1.jpg/640px-Chicago_sunrise_1.jpg", "url": "https: //en.wikipedia.org/wiki/Chicago "," City "" "" "" "" "" "" Feature "," Geometry ": {" Type ":" Point "," No Coordinates ": [-74.00, 40.71]}," Properties ": {" Picture ":" https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/NYC_Top_of_the_Rock_Pano.jpg/640px-NYC_Top_of_the_Rock_Pano.jpg "," Url ":" https://en.wikipedia.org/wiki/ New_York_City "," City ":" New York City "}}]  

What am I missing here is? Just to be clear, the icons appear, but until I add the CSS fixes mentioned in the linked SO post, they were not clicked, and now, I can click on the icons, but Nothing happens (properties do not appear in a pop-up). I think GeoJSON example above is a feature collection, and I have written the above

  {"type": "FeatureCollection", "features": & lt; Above material from GeoJSON & gt; }  

But that has not changed the behavior, is it a layering issue? If so, how do I merge all the layers in my map? I have a base map loaded from the Mapbox, a marker created by the user that I

  marker = L. marker ([latitude, LNG], {icon: L.divIcon ()) I want to use. {IconSize: [10, 10]})}); Icon loaded with  

and above / updatedIcons , which all I want to be clickable.

Any help is appreciated. Thanks!

And to add a popup (or bind) feature group you want something like

  allMyIcons = L.mapbox.featureLayer () . LoadURL ("/ updatedIcons"); AllMyIcons.bindPopup ("how are!"); AllMyIcons.addTo (map);  

If you want to get each marker / icon your unique popup, you can loop through them, as you add unique popups as an annotation

P>

  AllMyIcons.eachLayer (function (layer) {layer.bindPopup ('Howdy:' + count); count + = 1;});  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -