2

First off I'm a novice at JS so please bear with me if this is a simple task to complete.

I'm currently using the stock LeafletJS popup bubble to display the properties from my geoJSON. However, I would like to utilize the jQuery Mobile Panel to display the properties from my geoJSON file when it is clicked on, it is similar to the OpenLayers example here. Thanks in advance and below is my code for loading the geoJSON!

$.getJSON(dict[geoJSON Variable Goes here],
      function(data){
        L.geoJson(data, {
          style: style,
           onEachFeature: function (feature, layer){
             if (feature.properties.SOMETHING == 0){
                 return layer.bindPopup("<b><em>" + feature.properties.Name + "</em> LABEL<br />LABEL</b>");}
                else if (feature.properties.Attacks == 1){
                         return layer.bindPopup("<b><em>" + feature.properties.Name + "</em> LABEL<br />" + feature.properties.SOMETHING + " label</b>");}
                else {
                      return layer.bindPopup("<b><em>" + feature.properties.Name + "</em> LABEL<br />" + feature.properties.SOMETHING + " label</b>");
                                }
                            },
                        }).addTo(GROUPLAYER FOR LAYER ON/OFF);
                    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.