-
Couldn't load subscription status.
- Fork 916
Java and Objective C or JavaScript. Which one do you like?
Google Maps Mobile SDKs bring better performance into your app, however, you need to understand Objective-C (for iOS) and Java (for Android). If you are familiar with them, you don't need to use this plugin.
However if you are not, you may consider this plugin. This plugin provides JavaScript API, which allows you to write down the code for using Google Maps Mobile SDKs.
For instance, the code for adding a marker using this plugin is like the below:
var place = new LatLng(37.422858, -122.085065);
map.addMarker({
'position': place,
'title': ["Android Development",
"using Cordova/PhoneGap",
"and Google Maps Plugin!"].join("\n"),
'snippet': "Thursday, March 20, 2014 / GDG Los Angeles"
}, function(marker) {
marker.showInfoWindow();
});It's very simple, isn't it?
If you write the same code using Java …*
GoogleMap map = ((MapFragment) getFragmentManager() .findFragmentById(R.id.map)).getMap();
GoogleMap.CancelableCallback callback = new GoogleMap.CancelableCallback() {
@Override
public void onFinish() {
LatLng place = new LatLng(37.422858, -122.085065);
Marker marker = map.addMarker(new MarkerOptions()
.title("Hello Google Maps for Cordova!")
.snippet("This plugin is awesome!")
.position(place));
marker.showInfoWindow();
}
@Override
public void onCancel() {}
});
int durationMS = 4000;
map.animateCamera(cameraUpdate, durationMS, callback);If you write the same code using Objective-C …
[CATransaction begin]; {
[CATransaction setAnimationDuration: duration];
[CATransaction setAnimationTimingFunction:
[CAMediaTimingFunction functionWithName:
kCAMediaTimingFunctionEaseIn]];
[CATransaction setCompletionBlock:^{
[self.commandDelegate sendPluginResult:
pluginResult callbackId:command.callbackId];
}];
[self.mapCtrl.map animateToCameraPosition: cameraPosition];
} [CATransaction commit];Do you want to use Java and Objective-C, or JavaScript?
If you get an error, feel free to ask me on the official community or the issue list.
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md
New versions will be announced through the official community. Stay tune!
Feel free to ask me on the issues tracker.
Or on the official community is also welcome!
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md