Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the default zoom of map #345

Open
ragavendra opened this issue Feb 8, 2024 · 2 comments
Open

Changing the default zoom of map #345

ragavendra opened this issue Feb 8, 2024 · 2 comments

Comments

@ragavendra
Copy link

hi,

Like asked in stack overflow here

I would like to change the default zoom setting of the map.

The default leaflet zoom setting for leaflet is as below.

var center_ = [0, 0];
var map = L.map('map', {
  center: center_,
  zoom: 16
});

L.Control.geocoder().addTo(map);
@Jack-Leey
Copy link

geocoder.options.geocoder.reverse(e.latlng, map.getZoom(), function(results){
console.log(results[0].name);
});
Why is the output always the country name regardless of the value of Zoom!! Here is a reference: https://wiki.openstreetmap.org/wiki/Zh-hans:Nominatim

@Jack-Leey
Copy link

geocoder.options.geocoder.reverse(e.latlng, map.getZoom(), function(results){ console.log(results[0].name);为什么输出始终是国家/地区名称,而不管 Zoom 的值如何!!这是一个参考:https://wiki.openstreetmap.org/wiki/Zh-hans:Nominatim

ok!! i know how to solve the problem: replace "map. options. crs. scale (map. getZoom())" to solve it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants