Leaflet / Leaflet.VectorGrid

Display gridded vector data (sliced GeoJSON or protobuf vector tiles) in Leaflet 1.0.0
598 stars 194 forks source link

point change to icon #146

Closed Chadjhou closed 6 years ago

Chadjhou commented 6 years ago

hello gays i use this in my code,

var tile = L.vectorGrid.slicer(geojson,{
                    interactive: true,
                    rendererFactory: L.canvas.tile,
                    vectorTileLayerStyles:{
                        sliced: { icon: new L.Icon.Default()}
                    }
                    }).addTo(map);
tile.on('click', function(e) {
                        var pro = e.layer.properties;
                        var HTML = '';
                        for (var q in pro) {
                            HTML += q + ":" + pro[q] + '<br />';
                        }
                        L.popup()
                            .setContent(HTML)
                            .setLatLng(e.latlng)
                            .openOn(map);
                    })

and now i can get icon on my map but if move mouse moveon icon and i get some error like that ""Uncaught TypeError: Cannot read property 'lat' of undefined""

someone can help me??

i use leaflet 1.2.0 in chrome thx

IvanSanchez commented 6 years ago

Can you publish a fiddle/codepen/plunkr that displays this behaviour?

Chadjhou commented 6 years ago

dear @IvanSanchez thx your remind!! example is here : https://plnkr.co/edit/FdHsFj4WbheXT90z1fTm?p=preview

Chadjhou commented 6 years ago

i create a new issue #148