Comments (6)
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.
Thanks for quick reply.
What about Textbox? Is there a way to change that?
from leaflet.illustrate.
Can you clarify your question? What are you asking about textboxes?
from leaflet.illustrate.
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.
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.
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)
- read-only mode HOT 3
- textbox.getTextarea not available in v0.0.2 release HOT 3
- missing images/spritesheet-2x.png
- Include textbox tool to leaflet.draw HOT 9
- Printing possibilities? HOT 1
- Example link in README is broken HOT 1
- Republish on npm with spritesheet-2x.png included HOT 1
- Textbox mouseover/out handlers enabling/disabling dragging causes dragging to be enabled when you don't want it to be
- conflict with leaflet.draw 0.3.0 version
- It can't be used with with leaflet 1.0+
- text box handles are missing HOT 1
- Angular Typescript with leaflet-illustrate HOT 1
- Leaflet illustrate with medium editor HOT 1
- Restoring text box objects from their GeoJSON objects saved in local storage HOT 1
- Internationalization using i18n
- Not working on current leaflet
- Alternative to this plugin with current version of Leaflet?
- Map layers offset to show off-screen texbox
- Attribution in example HOT 2
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.illustrate.