Leaflet / Leaflet/Leaflet.VectorGrid

geojson point change circle marker to icon

Open
#148 28 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
676
Forks
202
PR merge metrics
No merged PRs in 30d

Description

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

example is here : https://plnkr.co/edit/FdHsFj4WbheXT90z1fTm?p=preview
thx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Plunker reproduction and the L.vectorGrid.slicer configuration shown in the issue, focusing on the icon hover path that produces the undefined-lat error. Confirm the failure with Leaflet 1.2.0 and determine what needs to change so moving over the point icon no longer throws the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.