Allow the use of custom GMapTypes via the Layer.Google. When passed a type in
the Layer.Google constructor, we check if the type we are given is not in the map's list of types, and if so, add it. (Closes #1082) r=tschaub git-svn-id: http://svn.openlayers.org/trunk/openlayers@5504 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -159,6 +159,13 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
*/
|
||||
setMapType: function() {
|
||||
if (this.mapObject.getCenter() != null) {
|
||||
|
||||
// Support for custom map types.
|
||||
if (OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),
|
||||
this.type) == -1) {
|
||||
this.mapObject.addMapType(this.type);
|
||||
}
|
||||
|
||||
this.mapObject.setMapType(this.type);
|
||||
this.map.events.unregister("moveend", this, this.setMapType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user