-
Notifications
You must be signed in to change notification settings - Fork 820
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
Zoom control icons disappear after configuring zoomControlOptions position #1308
Comments
I've never used this option myself and I don't currently have a handy Angular project with me where I can quickly try this, but upon inspecting the source code, I see that |
thx, lazarljubenovic. I am new to typescript. |
Need to install googlemap types Then in the component import the types. Then need to define the position for use through a variable in the component
Then pass that through interpolation to the element Works when I try it in your stackblitz example above. |
@timcblank Many thx for your help. You solution works in the stackblits example. |
"google" is defined as a type from the types install with the project. You get access to those types from import. Make sure you've also included the AgmModule with your app module and any lazy loaded modules using AGM correctly as well. That info should be part of the getting started bit on the website for this library. |
@timcblank thx for the tips. After some struggling, I found the way. I assigned the value in onMapReady(map) { You solution SOLVED my issue. Millions of thanks tim! |
I use Agm with ionic 3.x. To help other people. Here is what I did: import { } from 'googlemaps'; zoomPosition: any //Defined the variable above the constructor map.setOptions({ 3.html: <agm-map @timcblank thanks again. People like you deserve lots of respect. |
@lolaswift not sure how you got it working this is what i did zoomPosition = google.maps.ControlPosition.TOP_LEFT i still get 'ReferenceError: google is not defined' any help will be appreciated! thanks |
@sumitdaga onMapReady(map) { Don't forget to have mapReady on your template like this: |
Thanks a lot ! ...it worked ! thanks anyway |
@sumitdaga |
All googlemap types are imported through the command
You don't need to declare the variable google at all. It becomes available inside the MapsAPILoader load function or onMapReady function or inside a function called from the map element on callback. You can't use the google types outside that. |
All you need is to:
|
thanks! @shoudaos this makes more sense! |
@shoudaos. Many thanks! |
➡️ Im closing this because I don't see any bug. Feel free to reopen if you still think there's a bug or comment below. |
@SebastianM I am alson stuck with this issue |
@mahfuzur . I do it like this ts:
html:
|
I feel like this is an issue, or the documentation should be updated. The documentation tells me I can do
Instead I have to do
|
thanks you! this solution helped me |
don't follow @lolaswift or @diomededavid 's advice ;) set position to If all else fails, you can look up the position value from here:
and set In AGM2.0 this will be addressed comprehensively |
Issue description
zoomControlOptions position is not working
Steps to reproduce and a minimal demo of the problem
<agm-map
[latitude]="lat"
[longitude]="lng"
[zoom]="zoom"
[zoomControl]="true"
[zoomControlOptions]="{position: 'TOP_LEFT'}"
(mapClick)="mapClicked($event)"
(mapReady)="onMapReady($event)">
_Use https://plnkr.co or similar -- try this template as a starting point: http://plnkr.co/edit/YX7W20?p=preview
https://stackblitz.com/edit/angular-google-maps-demo-7cmc4g?file=app/app.component.html
What steps should we try in your demo to see the problem?
Current behavior
Zoom controls disappear
Expected/desired behavior
Should show on the position specified
angular2 & angular-google-maps version
angular 5.0, latest angular-google-maps version
Other information
The text was updated successfully, but these errors were encountered: