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.

bug(google-maps): missing setZoom()

See original GitHub issue

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

the setZoom() method is missing in the new angular google-maps component.

Reproduction

use "@angular/google-maps": "14.0.4",

Expected Behavior

being able to change the zoom of the map as follow

  @ViewChild('googleMap', { static: true }) googleMap: GoogleMap
  
  setZoom(zoom: number) {
     this.googleMap.setZoom(zoom)
  }
<google-map
  #googleMap
  width="100%"
  height="100%"
  [options]="options"
>
</google-map>

Actual Behavior

Property ‘setZoom’ does not exist on type ‘GoogleMap’. Did you mean ‘getZoom’?

Environment

  • Angular: v14.0.6
  • CDK/Material: 14.0.4
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
noobyogi0010commented, Jul 30, 2022

Hey @amysorto I would like to work on this issue if no one else is already using it. Thanks!

1reaction
amysortocommented, Jul 22, 2022

Seems like we are using this function already so this seems like it won’t be difficult to add: https://github.com/angular/components/blob/main/src/google-maps/google-map/google-map.ts#L290

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google maps setZoom not working correctly - Stack Overflow
The problem is sometimes the zoom in the map doesn't reflect the value I provide, although I'm printing out the zoom level via...
Read more >
SetZoom Error - Google Groups
the setZoom from my GeoAddress function the error is gone. Thing is I need ... Your resetGeo() function calls initialize() which will create...
Read more >
Geocoding Service | Maps JavaScript API - Google Developers
You access the Google Maps API geocoding service within your code via the google.maps ... The Geocoder.geocode() method initiates a request to the...
Read more >
Zoom to fit in Views not working on Google Map - Drupal
The zoom level set in the Google Maps Settings in Views is being used. ... setZoom() (line 228) in geolocation-api.jssolved solved the zoom ......
Read more >
panTo() before setZoom() changes LatLng [35819961]
example bug code: google.maps.event.addListener(curMarker, 'click', function() { curMarker.setIcon("images/a-marker.png"); var panLoc = new google.maps.
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