Hi
Can you confirm that it is possible to set myLocationButton and myLocation separately?
See Issue and Release notes
I have tried to implement this but setting myLocationButton to false in map controls does not remove it.
Thanks
Which version of ionic-native/google-maps are you using?
Hi
ionic-native/google-maps: 4.6.3
cordova-plugin-googlemaps: 2.2.9
It's strange. I'm still using ionic-native/google-maps version 4.6.0 and cordova-plugin-googlemaps 2.2.8 and initialize my map like this:
this.map = GoogleMaps.create(<mapElement>,
{
controls : {
compass : false,
myLocationButton : false,
myLocation: true,
indoorPicker : false,
zoom : false,
mapToolbar : false
},
...
...and I can see the blue dot in the map but the my location button is removed. Are you trying to remove the button after the map has been initialized using the setMyLocationEnabled() and setMyLocationEnabled() functions calls? If so, I've never tried that option, but I am sure removing the button works at the time of initialization.
Amazing, thanks for the help :)
It seems to be working now. I had set my controls in this.maps.setOptions() but changed it to your example and now the button is removed.
No worries, glad it helped.
You might want to check my Ionic Google Maps example. I will update it soon according to the latest changes.
Thank you for helping other people, @battika.
My pleasure hope I can spare some time for you :)
@wf9a5m75: Sir but in my case location myLocationButton is not show in the map i am using 2.4.4 version?
@battika its not working for me. myLocationButton is not showing up my code is as follows:
controls : {
compass : false,
myLocationButton : true,
myLocation: true,
indoorPicker : false,
zoom : false,
mapToolbar : false
}
Only zoom property seems to work
@battika its not working for me. myLocationButton is not showing up my code is as follows:
controls : { compass : false, myLocationButton : true, myLocation: true, indoorPicker : false, zoom : false, mapToolbar : false }Only zoom property seems to work
I'm having this issue too. When I set zoom to false it removes the +/- buttons, but the other options, such as the compass does not work.
Most helpful comment
No worries, glad it helped.
You might want to check my Ionic Google Maps example. I will update it soon according to the latest changes.
https://github.com/battika/ionic-gmaps-test