Giter Site home page Giter Site logo

Comments (5)

JulieGoldberg avatar JulieGoldberg commented on May 22, 2024 6

Was a workaround for this ever implemented? I'd like to use it if so.

from leaflet.vectorgrid.

albanm avatar albanm commented on May 22, 2024 3

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.

perliedman avatar perliedman commented on May 22, 2024

Hi @albanm,
this is not currently possible - points can be styled as CircleMarkers or Icons, 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.

IvanSanchez avatar IvanSanchez commented on May 22, 2024

@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.

perliedman avatar perliedman commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.