Cordova native Google Maps SDK plugin with Meteor


#1

Hi guys, I’m developing a location based app with Meteor and stumbled across this Cordova Google maps plugin: https://github.com/phonegap-googlemaps-plugin/cordova-plugin-googlemaps

The good thing is that this plugin uses native Google Maps SDKs, which should be much more performant than the JavaScript API, and I think this is the way to go for Meteor mobile apps.

Anybody has experience with it and Meteor? I would also glad to hear if you guys have tipps or any alternatives, thx!


#2

here too :wink:

there is a plugin for meteor already - in the making maybe?

https://atmospherejs.com/gwendall/google-maps-cordova


#3

Oh thanks for the link, I will give it a try.

I also want to share this nice post from thebakery.io team, they also experimenting the same thing:
http://blog.thebakery.io/native-ios-maps-with-meteor-and-cordova/


#4

I’ve used it extensively with my current cordova project. Overall, it’s really good, but there are some caveats that i’ve had to make that werent exactly minor.

  1. The StatusBar plugin and g-maps dont play well together. I’ve hacked around it but the g-maps plugin right now doesnt have a build in solution. Basically unexpected stuff will happen like webview getting shifted down when it shouldnt be, or the map getting shifted up where it shouldnt.

  2. If you want to use crosswalk you have to modify the crosswalk plugin files directly, which means either making it a local package or forking the plugin and using that instead of the main crosswalk repo.

  3. The way they implemented InfoWindows is unfortunate. You can only have one info window open at once for any marker. If you need multiple info windows, you should not use the g-maps plugin unless you want to fix their implementation in native code.

  4. If you want to use things like eta / distance calculations or directions, you still need to use the js maps libraries and feed them into your cordova-google-maps plugin.

So other than those three, its much faster and smoother than the JS maps. Especially animations, js maps are lacking completely in the camera animations department. It really makes your app feel 100% more native if a major feature of your app is maps.

If you need any specific help, free to message me.


#5

@pmwisdom

Thanks for sharing more details on this project.

I tried to install via “meteor add thebakery:mobile-map” .
Yet it does say : “no such package”.

Is there an “official” meteor package available?

EDIT: ok I misread the post. there is no official one. I will try installing from github

BTW: is it mature for Android-use? And what key-features of the underlying “cordova-plugin-googlemaps” are missing


#6

More of a general question:

The native version is using googleMaps_v2 whereas the JS-version is using googleMaps_v3. I was playing around with v3 and did not have to give it a ANDROID_KEY nor any other key also in production. Is there a difference between v2 and v3. Or is it due to native vs js ?

Thanks


#7

Right, its native vs js. I don’t think they can completely be comparable. v2 is the most recent version of the android google maps.

You don’t need a package for installing cordova google maps. You can install it right from the command line, like so:

meteor add cordova:plugin.google.maps@https://github.com/phonegap-googlemaps-plugin/cordova-plugin-googlemaps.git#ae2f01721983bf649b827601c4e930c82ae0951e


#8

@pmwisdom thank you very much, glad there is somebody who is already using it extensively. Good to know the caveats beforehand. I will play around with it and also share my experiences.


#9

Hi @pmwisdom !
I am glad you have knowledge of this. I am in the same position. My app idea heavily relies on distance / time calculations. What is your experience using these features with cordova-google-maps? Should I try it, or stick with the regular JS google maps API instead?

BTW @eddieux How is your app going with the plugin? are you using it?


#10

@emilios1995 If your app is showing a google map for most of its foreground lifetime I would say definitely use cordova google maps. That is, unless you need multiple info windows open at the same time.

However for distance / time calculations you still need to use the javascript library to do those and load them into your native google maps instance ( its not hard ). If you need help with that, let me know.

I would say just load it in and try it out for yourself though. Even an empty map will give you a feel for how different it is.


#11

@emilios1995 not yet, since i’m still occupied with other features of my app, but it’s definitely in my roadmap. I’m still using the Javascript Maps for prototyping reasons. For my app, the biggest minus with Javascript Maps is the amount of map tiles data that has to be downloaded real time. For example, I just measured that panning around my city easily hit over 1 MByte of traffic, quite a big no-go for maps heavy apps.


#12

Haven’t had a chance to try it yet, but Uber just released this. It looks like it renders vector maps tiles client side, the same way native google maps does, so should use less bandwidth. Always wondered why google JS maps doesn’t operate that way…