question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get the zoom level

See original GitHub issue

hi,

is it possible to get the current zoom level upon the onZoomChanged event?

i attached the event handler in this way :

onZoomChanged={this.onZoomChanged}

but any parameter i add on that function results to be undefined.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MicheleBertolicommented, Sep 12, 2016

hello @riccardolorenzon

the zoom_changed event is not passing any arguments:

screen shot 2016-09-12 at 5 15 27 pm

what you can do is to use the reference to the actual map instance:

handleZoomChanged() {
  console.log('zoom:', this.refs.Gmaps.getMap().getZoom());
},

zoom source

hope this helps!

0reactions
riccardolorenzoncommented, Sep 13, 2016

Yeah, it works!

Grazie!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find current zoom level in a Google Map?
If you have a map object like this: ... Use this code: float zoomlevel = mMap.getCameraPosition().zoom; ... If you need to get zoom...
Read more >
Map.getZoom - Earth Engine - Google Developers
Examples. Returns the current zoom level of the map. ... Here, the defaultMap is centered on a point with a selected zoom level....
Read more >
How can i get current zoom level - Google Groups
Hi everybody. I'm new in Google Maps. currently I need a change on this article for add a zoom level to MySQL. How...
Read more >
How to detect page zoom level in all modern browsers using ...
Method 1: Using outerWidth and innerWidth Property: It is easier to detect the zoom level in webkit browsers like Chrome and Microsoft Edge....
Read more >
Zoom levels and scale | Documentation - ArcGIS Developers
A zoom level or scale is a number that defines how large or small the contents of a map appear in a map...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found