https://github.com/mapsplugin/v2.0-demo
https://github.com/mapsplugin/v2.0-demo
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mapsplugin/v2.0-demo
- Owner: mapsplugin
- Created: 2016-09-30T21:27:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T16:48:29.000Z (about 6 years ago)
- Last Synced: 2025-01-14T05:43:43.907Z (about 1 year ago)
- Language: HTML
- Size: 133 MB
- Stars: 17
- Watchers: 6
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cordova-google-maps v2.3.0 example
This is example application of [cordova-plugin-googlemaps v2.3.0](https://github.com/mapsplugin/cordova-plugin-googlemaps/).
## What the big change has been occurred at v2.3.0?
### MAP_READY
From the cordova-plugin-googlemaps version 2.3.0, you can omit the `MAP_READY` event listener.
**v2.0-v2.2.9 (old code syntax)**
```
var map = plugin.google.map.Map.getMap(mapDiv);
map.addEventListener(plugin.google.maps.event.MAP_READY, funciton() {
map.setMapTypeId(plugin.google.maps.MapTypeId.HYBRID);
});
```
**from v2.3.0 (new code syntax)**
```
var map = plugin.google.map.Map.getMap(mapDiv);
map.setMapTypeId(plugin.google.maps.MapTypeId.HYBRID);
```
### Simplified `map.addXXX()` methods
From the v2.3.0, you can also omit the second arguments of `map.addXXX()` methods.
**v2.0-v2.2.9 (old code syntax)**
```
var map = plugin.google.map.Map.getMap(mapDiv);
map.addEventListener(plugin.google.maps.event.MAP_READY, funciton() {
map.addMarker({
position: {
lat: 0, lng: 0
}
}, function(marker) {
marker.showInfoWindow();
});
});
```
**from v2.3.0 (new code syntax)**
```
var map = plugin.google.map.Map.getMap(mapDiv);
var marker = map.addMarker({
position: {
lat: 0, lng: 0
}
});
marker.showInfoWindow();
```
You can still write with the old code syntax.
-----
# Demo apk
You can try all features of this plugin.
[Click to download the demo apk (Android)](https://github.com/mapsplugin/v2.0-demo/blob/master/cordova-googlemaps-v2-demo_35.apk?raw=true)
## How to install the apk file.
After download the apk file from the above link, install it to your android.
```bash
$> adb uninstall cordova.google.maps // if you installed this app before.
$> adb install cordova-googlemaps-v2-demo_35.apk
```

----
## How to build the demo app
In order to use this demo, please follow the below commands:
```
$> git clone https://github.com/mapsplugin/v2.0-demo
$> cd v2.0-demo
// Install the maps plugin
$> cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="..." --variable API_KEY_FOR_IOS="..."
```
----
## Documentations
The documents are below.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/README.md