Skip to content

Latest commit

 

History

History
135 lines (110 loc) · 5.77 KB

File metadata and controls

135 lines (110 loc) · 5.77 KB

⚠️ This document is aim for older versions (from 2.0.0 to 2.2.9). Document for new version is https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/README.md

Method names are renamed

Several methods have been renamed in v2. Please rewrite your code accordingly.

method names
v1v2
map.setCenter()map.setCameraTarget()
map.setZoom()map.setCameraZoom()
map.setBearing()map.setCameraBearing()
map.setTilt()map.setCameraTilt()
map.getCenter()map.getCameraTarget()
map.getZoom()map.getCameraZoom()
map.getBearing()map.getCameraBearing()
map.getTilt()map.getCameraTilt()
map.setBackgroundColor()Environent.setBackgroundColor()

Deprecated and not yet ready

These methods have not been implemented yet, because of deprecated considering or technically hard work is required.

method names
v1v2
map.showDialog()Deprecated considering
map.closeDialog()Deprecated considering
map.setDebuggable()Technically not ready yet
map.refreshLayout()Actually implemented, but you don't need to use this anymore.
Instead of this method, trigger the plugin_touch event.
map.addKmlOverlay()technically not ready yet

Version 1.x events

event name Androide iOS
MAP_CLICK YES YES
MAP_LONG_CLICK YES YES
MY_LOCATION_CHANGE YES NO
MY_LOCATION_BUTTON_CLICK YES YES
INDOOR_BUILDING_FOCUSED YES YES
INDOOR_LEVEL_ACTIVATED YES YES
CAMERA_CHANGE YES YES
CAMERA_IDLE NO YES
MAP_READY YES YES
MAP_LOADED YES NO
MAP_WILL_MOVE NO YES
MAP_CLOSE YES YES
OVERLAY_CLICK YES YES
INFO_CLICK YES YES
MARKER_DRAG YES YES
MARKER_DRAG_START YES YES
MARKER_DRAG_END YES YES

Version 2.x events

event name Androide iOS arguments[0]
MAP_READY YES YES none
MAP_CLICK YES YES LatLng
MAP_LONG_CLICK YES YES LatLng
MY_LOCATION_BUTTON_CLICK YES YES none
INDOOR_BUILDING_FOCUSED YES YES none
INDOOR_LEVEL_ACTIVATED YES YES building information
CAMERA_MOVE_START YES YES true if the camera move start by gesture
CAMERA_MOVE YES YES CameraPosition
CAMERA_MOVE_END YES YES CameraPosition
POLYGON_CLICK YES YES LatLng(clicked position)
POLYLINE_CLICK YES YES LatLng(clicked position)
CIRCLE_CLICK YES YES LatLng(clicked position)
GROUND_OVERLAY_CLICK YES YES LatLng(clicked position)
INFO_CLICK YES YES LatLng(marker position)
INFO_LONG_CLICK YES YES LatLng(marker position)
INFO_CLOSE YES YES LatLng(marker position)
INFO_OPEN YES YES LatLng(marker position)
MARKER_CLICK YES YES LatLng(marker position)
MARKER_DRAG YES YES LatLng(marker position)
MARKER_DRAG_START YES YES LatLng(marker position)
MARKER_DRAG_END YES YES LatLng(marker position)

removed the xxxClicked properties

Version 2 does not support xxxClicked properties anymore. Please use addEventListener() or on() methods instead.

// version 1
map.addMarker({
  position: ...
  markerClick: function(marker) {
    marker.showInfoWindow();
  }
});


// version 2
map.addMarker({
  position: ...
}, function(marker) {

  marker.addEventListener(plugin.google.maps.event.MARKER_CLICK, function() {
    marker.showInfoWindow();
  });

});

LatLng.toUrlValue() and LayLng.toString() return values changed

In version 2 the two methods LatLng.toUrlValue(precision) and LatLng.toString(), no longer return a string in the format of "lat,lng" like Google Maps JS API, but a stringified JSON value.

// v1
var strLatlng = latLng.toUrlValue();

// equivalent in v2
var strLatlng= latLng.lat + "," + latLng.lng;