Coder Social home page Coder Social logo

torfsen / leaflet.zoomhome Goto Github PK

View Code? Open in Web Editor NEW
49.0 49.0 33.0 112 KB

A Leaflet zoom control with a home button for resetting the view.

Home Page: https://torfsen.github.io/leaflet.zoomhome

License: Other

JavaScript 66.65% HTML 33.35%

leaflet.zoomhome's People

Contributors

jvolker avatar m1dst avatar npmcdn-to-unpkg-bot avatar pmacmaps avatar torfsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

leaflet.zoomhome's Issues

Execute custom function on button click?

I'd like to execute a custom function to clear all of the markers on my map when I click the zoomHome button. Is there a way to execute this on click? I don't see any information in the documentation about that.

Zoom home offset if sidebar is open

Hi guys, this is my webmap:

www.mainjoin.eu/map/santiago/

Everything works perfectly: sidebar(v2), autopan, popup content go in sidebar panels fine.

Only a few trouble. At top right I have zoom home button.
When sidebar is close everything go fine: zoom home button center my map.
When sidebar is open the zoom home makes the same thing but the sidebar hide part of my center map.
I'd like a little right-offset on result of zoom home button when sidebar is open.
Something like:

if sidebar.close() = true
zoomhome
else
zoomhome.offset

Any advices are welcome, thanks!
Valerio

`title="Home"` may be misinterpreted by blind users

The word "home" (specifically in the context of maps) may be misinterpreted by blind users to mean the individual's home (perhaps indicative of obtaining the user's location through the Geolocation API).

Please consider a different wording for the zoomHomeTitle:

zoomHomeTitle: 'Home',

Examples for another default title: "Reset view", "Reset to initial view", "Reload view", "Reload map".

Reference discussion: Canadian-Geospatial-Platform/geoview#192

Incompatibility with GoogleMutant plugin

Hi Florian,

first thanks for providing this leaflet plugin - we are using it in our WordPress mapping plugin "Maps Marker Pro" (send me an email to get a free dev license ;-)

For the upcoming v3.0 release of our plugin, we also upgraded to GoogleMutant leaflet plugin for displaying Google maps. We now found that there seems to be an issue with leaflet.zoomhome and GoogleMutant: if the zoomhome button is clicked, tiles are missing:

zoom-home-issue

We posted this as a new ticket at https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant/issues/29 and also created a jsfiddle at https://jsfiddle.net/ennv4ckr/2/

As we havent found out why this issue occurs in the first place (especially as only setView() is called which shouldnt lead to an issue in our opinion), it would be great if you could have a short look at the issue too and tell us if you think this needs to be fixed by GoogleMutant only or if the issue could also be fixed within the leaflet.zoomhome repository.

Your reply would be much appreciated!
best,

Robert

Control doesn't handle browser resize if bounds are set

Users can use setHomeBounds to store a default bounds region for the home button.

In this method the zoom level for that bounds is calculated and stored.

But, if the browser is resized, that zoom level is now invalid.

The issue can be overcome if the bounds object is stored in the options, then the zoom level calculated in the go-home operation.

homeZoom function

What is the proper way of calling this function? I have initialized a zoomHome and call it saying zoomHome.homeZoom() but I keep getting an error that homeZoom() is not a function.

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.