(Browser)Implement stub methotds
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.4.0-ext-20180822-2234" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.4.0-ext-20180823-1326" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs/>
<param name="onload" value="true"/>
<param name="onreset" value="true"/>
</feature>
- <feature name="Map">
+ <feature name="PluginMap">
<param name="android-package" value="plugin.google.maps.PluginMap"/>
</feature>
- <feature name="Polyline">
+ <feature name="PluginPolyline">
<param name="android-package" value="plugin.google.maps.PluginPolyline"/>
</feature>
- <feature name="Polygon">
+ <feature name="PluginPolygon">
<param name="android-package" value="plugin.google.maps.PluginPolygon"/>
</feature>
- <feature name="Marker">
+ <feature name="PluginMarker">
<param name="android-package" value="plugin.google.maps.PluginMarker"/>
</feature>
- <feature name="Circle">
+ <feature name="PluginCircle">
<param name="android-package" value="plugin.google.maps.PluginCircle"/>
</feature>
- <feature name="TileOverlay">
+ <feature name="PluginTileOverlay">
<param name="android-package" value="plugin.google.maps.PluginTileOverlay"/>
</feature>
- <feature name="GroundOverlay">
+ <feature name="PluginGroundOverlay">
<param name="android-package" value="plugin.google.maps.PluginGroundOverlay"/>
</feature>
- <feature name="KmlOverlay">
+ <feature name="PluginKmlOverlay">
<param name="android-package" value="plugin.google.maps.PluginKmlOverlay"/>
</feature>
- <feature name="Geocoder">
+ <feature name="PluginGeocoder">
<param name="android-package" value="plugin.google.maps.PluginGeocoder"/>
</feature>
- <feature name="LocationService">
+ <feature name="PluginLocationService">
<param name="android-package" value="plugin.google.maps.PluginLocationService"/>
</feature>
- <feature name="Environment">
- <param name="android-package" value="plugin.google.maps.Environment"/>
+ <feature name="PluginEnvironment">
+ <param name="android-package" value="plugin.google.maps.PluginEnvironment"/>
</feature>
- <feature name="MarkerCluster">
+ <feature name="PluginMarkerCluster">
<param name="android-package" value="plugin.google.maps.PluginMarkerCluster"/>
</feature>
- <feature name="StreetViewPanorama">
+ <feature name="PluginStreetViewPanorama">
<param name="android-package" value="plugin.google.maps.PluginStreetViewPanorama"/>
</feature>
</config-file>
<param name="onload" value="true"/>
<param name="onreset" value="true"/>
</feature>
- <feature name="Environment">
- <param name="ios-package" value="Environment"/>
+ <feature name="PluginEnvironment">
+ <param name="ios-package" value="PluginEnvironment"/>
</feature>
- <feature name="Geocoder">
+ <feature name="PluginGeocoder">
<param name="ios-package" value="PluginGeocoder"/>
</feature>
- <feature name="LocationService">
+ <feature name="PluginLocationService">
<param name="ios-package" value="PluginLocationService"/>
</feature>
- <feature name="Map">
+ <feature name="PluginMap">
<param name="ios-package" value="PluginMap"/>
</feature>
- <feature name="Circle">
+ <feature name="PluginCircle">
<param name="ios-package" value="PluginCircle"/>
</feature>
- <feature name="GroundOverlay">
+ <feature name="PluginGroundOverlay">
<param name="ios-package" value="PluginGroundOverlay"/>
</feature>
- <feature name="KmlOverlay">
+ <feature name="PluginKmlOverlay">
<param name="ios-package" value="PluginKmlOverlay"/>
</feature>
- <feature name="Marker">
+ <feature name="PluginMarker">
<param name="ios-package" value="PluginMarker"/>
</feature>
- <feature name="Polygon">
+ <feature name="PluginPolygon">
<param name="ios-package" value="PluginPolygon"/>
</feature>
- <feature name="Polyline">
+ <feature name="PluginPolyline">
<param name="ios-package" value="PluginPolyline"/>
</feature>
- <feature name="TileOverlay">
+ <feature name="PluginTileOverlay">
<param name="ios-package" value="PluginTileOverlay"/>
</feature>
- <feature name="MarkerCluster">
+ <feature name="PluginMarkerCluster">
<param name="ios-package" value="PluginMarkerCluster"/>
</feature>
- <feature name="StreetViewPanorama">
+ <feature name="PluginStreetViewPanorama">
<param name="ios-package" value="PluginStreetViewPanorama"/>
</feature>
</config-file>
<source-file src="src/ios/GoogleMaps/PluginGeocoder.m"/>
<header-file src="src/ios/GoogleMaps/PluginLocationService.h"/>
<source-file src="src/ios/GoogleMaps/PluginLocationService.m"/>
- <header-file src="src/ios/GoogleMaps/Environment.h"/>
- <source-file src="src/ios/GoogleMaps/Environment.m"/>
+ <header-file src="src/ios/GoogleMaps/PluginEnvironment.h"/>
+ <source-file src="src/ios/GoogleMaps/PluginEnvironment.m"/>
<header-file src="src/ios/GoogleMaps/CordovaGoogleMaps.h"/>
<source-file src="src/ios/GoogleMaps/CordovaGoogleMaps.m"/>
<header-file src="src/ios/GoogleMaps/PluginMapViewController.h"/>
<platform name="browser">
<preference name="API_KEY_FOR_BROWSER" value=""/>
- <hook type="after_prepare" src="src/browser/after_prepare.js"/>
+ <!-- <hook type="after_prepare" src="src/browser/after_prepare.js"/> -->
<js-module name="googlemaps-cdv-plugin" src="www/plugin-loader-for-browser.js">
<clobbers target="plugin.google.maps"/>
</js-module>
<js-module name="PluginGeocoder" src="src/browser/PluginGeocoder.js">
<runs/>
</js-module>
+ <js-module name="PluginEnvironment" src="src/browser/PluginEnvironment.js">
+ <runs/>
+ </js-module>
</platform>
</plugin>

MODIFY
src/browser/PluginMap.js
src/browser/PluginMap.js
@@ -152,7 +152,7 @@ function PluginMap(mapId, options, mapDivId) {
options.camera.target.forEach(function(pos) {
bounds.extend(pos);
});
- map.fitBounds(bounds, 20);
+ map.fitBounds(bounds, 10);
} else {
map.setCenter(options.camera.target);
}
@@ -250,6 +250,11 @@ PluginMap.prototype.clear = function(onSuccess, onError, args) {
onSuccess();
};
+PluginMap.prototype.getFocusedBuilding = function(onSuccess, onError, args) {
+ // stub
+ onSuccess(-1);
+};
+
PluginMap.prototype.setDiv = function(onSuccess, onError, args) {
var self = this,
map = self.get('map'),
@@ -321,6 +326,10 @@ PluginMap.prototype.setCameraTilt = function(onSuccess, onError, args) {
map.setTilt();
onSuccess();
};
+PluginMap.prototype.setMyLocationEnabled = function(onSuccess, onError, args) {
+ // stub
+ onSuccess();
+};
PluginMap.prototype.animateCamera = function(onSuccess, onError, args) {
var self = this;
@@ -405,7 +414,7 @@ PluginMap.prototype.setVisible = function(onSuccess, onError, args) {
};
PluginMap.prototype.setPadding = function(onSuccess, onError, args) {
- console.warn('map.setPadding() is not available for this platform.');
+ // stub
onSuccess();
};
PluginMap.prototype.setAllGesturesEnabled = function(onSuccess, onError, args) {
@@ -500,11 +509,13 @@ PluginMap.prototype.fromPointToLatLng = function(onSuccess, onError, args) {
};
PluginMap.prototype.setIndoorEnabled = function(onSuccess, onError, args) {
- onError('map.setIndoorEnabled() is not available for this platform.');
+ // stub
+ onSuccess();
};
PluginMap.prototype.toDataURL = function(onSuccess, onError, args) {
- onError('map.toDataURL() is not available for this platform.');
+ // stub
+ onSuccess();
};
PluginMap.prototype._syncInfoWndPosition = function() {

(Browser)Implement stub methotds