I followed this repo to create the google map native in Ionic
ionic google maps demo
I can not debug to see what's happened, only white screen.
I used native/core: 4.7.0 and #ionic-native/google-maps: ^4.7.0 and cordova-plugin-googlemaps: 2.2.9.
I enabled google map API already, and get the right key
Are you testing it on the browser? cordova-plugin-googlemaps is a native plug-in and cannot be view on browser. For testing, you will need to build it and test it on your device.
Read more here: https://ionicframework.com/docs/v1/guide/testing.html
Related
I'm using Ionic 3 and working on iPhone 7 plus with iOS 11. I'm using the Ionic native google maps plugin (http://ionicframework.com/docs/native/google-maps/). I have two sets of tabs (user/admin) and I need to switch between them with the following code:
switch() {
this.app.getRootNav().push(tabs2);
}
If I've loaded the map on Tabs1 and then move to Tabs2 and back to Tabs1 and try to load the map again, it doesn't load and only shows white screen.
I've seen solutions for this in other posts, where it was advised to "resize" the map in order to load it with the following code:
google.maps.event.trigger(this.map, 'resize');
As far as I know this is NOT the ionic native plugin (it's the JS web version). I'm having trouble in implement the same functionality with the native plugin. Or really any other solution will work just fine as well.
You need to detach the map before going back to Tabs1 from Tabs2.
// Detach
this.map.setDiv(null);
// Attach again
this.map.setDiv(div);
If you create a demo project, and share it on github, I will check it.
The problem of displaying the gray block when the map is loaded.
I tried both versions of the maps.
Native maps is not very suitable for many reasons, but it is loaded without gray blocks.
Google Maps API is completely suitable, but there is a problem when loading the map. Is it possible to somehow map the cache so that it is displayed as a native map?
Video links:
1) Native maps https://www.youtube.com/watch?v=3-nogB56zm8
2) Maps API https://www.youtube.com/watch?v=9P3STDooVkk
I understand you are using the Google Maps JavaScript API with Ionic 2. If so,
have a look at the following feature request in the public issue tracker:
https://issuetracker.google.com/issues/38110237
Feel free to star the feature request to express your interest and subscribe to further notifications from Google.
I am developing an application using Ionic framework and want to implement the google map & navigation feature within the application interface without using/redirecting it to Google Map application.
I am using type script/html/css/bootstrap language for developing the app. Please help me out to solve the problem. How to implement it within the app?
Thanks
Rajiv
If you look the Google documentation of official page: https://developers.google.com/maps/get-started/ then you'll find a example of code to use
I'm developing a simple app with google maps and I update ionic version from RC0 to RC1.
After this update, (google) maps is not visible anymore.
I use a cordoba-plugins-googlemaps and google key is correct and enabled.
I'd like to be more accurate, but I do not know where to look for the problem (I checked ionic consolelogs and log, with catlog, on my android smartphone).
Someone else has had the same problem and solved it?
Regards
matpil
I found the solution.
Problem is not google maps but ion-card.
Seems that a "google maps" insert into a doesn't works.
I had removed ioc-card and maps works fine.
Hope this can be useful...
Regards
matpil
Is posible to add a custom layers to the new Google Maps SDK for iOS?
*Custom layers in Tile images or in KML format.
In the documentation I see nothing about layers.
No there is not in this initial version. There is some hope though as the similar Android API has one.
I can only suggest raising a feature request