Comments (5)
Was a workaround for this ever implemented? I'd like to use it if so.
from leaflet.vectorgrid.
Vector tiles are sure great for rendering lots of features. But what I am interested in mostly is client side styling and intelligent simplification. Anyway even with lots of features not all layers are equally dense, for example the 'place' or 'poi' layers in osm tiles are ok.
Providing a hook to let the client add whatever it wants on top of the features in the tiles would be great !
I am willing to work on a PR for this.
from leaflet.vectorgrid.
Hi @albanm,
this is not currently possible - points can be styled as CircleMarker
s or Icon
s, nothing else.
Doing what you propose would be somewhat tricky: VectorGrid uses tiles with SVG or Canvas rendering, and naively adding labels to those would most certainly clip them in an undesirable way. Adding them as normal Leaflet layers would, on the other hand, change much of how VectorGrid basic design (a tile grid).
What I think we could do, is exposing something similar to L.GeoJSON
's oneachfeature
option, to allow users to hook on any logic they want; for that, we would also need a mechanism so that users can also clean up when features in tiles are removed.
from leaflet.vectorgrid.
@perliedman If a point can be styled with an Icon
, can a DivIcon
be used instead? If so, there's the text labels.
from leaflet.vectorgrid.
@IvanSanchez no, at the moment we just take the icon image and draw it onto the canvas (or use an SVG image
), so we're not even handling shadows or so...
I perceive VectorGrid's primary use case as "render a lot of things with decent performance", and adding one or more DOM elements per feature seems to go against this. But I realize there might be other reasons for using VectorGrid as well.
from leaflet.vectorgrid.
Related Issues (20)
- Build failed HOT 1
- Toggle polygon HOT 1
- I cant display points. I can't change the style points/polygons. HOT 1
- Define bounds or extent of VectorGrid layer HOT 2
- Demo pages with points don't work HOT 1
- Layer order inside a tile
- Some tiles not rendering HOT 2
- Uncaught TypeError: Cannot read properties of undefined (reading 'lat') HOT 4
- support L.divIcon
- Protobuf - Get clicked feature (or its geometry)
- Problem with Leaflet >= 1.8 HOT 3
- remove added layer from map HOT 2
- Project status / Alternative Fork?
- Nothing rendering with `_getVectorTilePromise` custom implementation HOT 3
- fillOpacity and fillColor have no effect when rendering circlemarkers HOT 1
- Styling points/circles differently from Polygons
- How can I use maxNativeZoom to continue to show the vector tiles beyond their maximum zoom level?
- While using vectorGrid.protobuf for displaying vector tiles on map i was not able to capture mouse events initially until when i zoomed out to minzoom level
- Filter not working with L.VectorGrid.Protobuf 🔴 HOT 2
- Does geojson-vt adjust resolution according to zoom level? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.vectorgrid.