Git Product home page Git Product logo

Comments (6)

justinmanley avatar justinmanley commented on June 16, 2024

That is the purpose of the lines provided by Leaflet.Illustrate, called pointers (see L.Illustrate.Pointer). Pointers retain fixed dimensions regardless of the zoom level.

If you want a line that will be fixed with respect to the map, rather than the window, you should use a polyline.

from leaflet.illustrate.

ihevcuk avatar ihevcuk commented on June 16, 2024

Thanks for quick reply.

What about Textbox? Is there a way to change that?

from leaflet.illustrate.

justinmanley avatar justinmanley commented on June 16, 2024

Can you clarify your question? What are you asking about textboxes?

from leaflet.illustrate.

ihevcuk avatar ihevcuk commented on June 16, 2024

Textboxes behaves the same as lines... If you draw textbox and then zoom out, textbox will be fixed with respect to the window. I need a textbox that is fixed with respect to the map.

Is there a way to do that or I need to hide textbox if zoom is changed?

from leaflet.illustrate.

justinmanley avatar justinmanley commented on June 16, 2024

Ah, I see.

No, that's not possible at the moment. I had imagined writing a bit of extra code linking each textbox to a specific zoom level, and then limiting textboxes to be visible only within n zoom levels of the original zoom level, for some reasonable n.

Text that changes size based on the zoom level is going to behave much more like a map label. One might modify L.Illustrate.Textbox to accommodate this kind of behavior by tweaking the contents of the CSS transform property to include a scaling factor based on the zoom level (see the call to setTransform in L.RotatableMarker.js and its definition in setTransform.js).

Take a look at the source code for Path.SVG.js in the Leaflet core library to see how scaling during zooming is implemented for paths - the implementation will likely be similar for textboxes.

Alternatively, the text might display more neatly if you scale the font size and the dimensions of the textbox, rather than brute-force dilating and shrinking the textbox via CSS transform: scale. This method would require more careful calibration.

from leaflet.illustrate.

jywarren avatar jywarren commented on June 16, 2024

Note that the text functionality described is part of issue #6 outlining proposed improvements for v0.0.3, if I read correctly. :-)

from leaflet.illustrate.

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.