Ox.Map: add public methods getCenter and setCenter
This commit is contained in:
parent
dfffe99a04
commit
f4cdfb3349
1 changed files with 23 additions and 0 deletions
|
@ -1476,6 +1476,17 @@ Ox.Map = function(options, self) {
|
||||||
addPlaceToPlaces(data);
|
addPlaceToPlaces(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
getCenter <f> Returns the map center
|
||||||
|
() -> <o> Map center
|
||||||
|
lat <n> Latitude
|
||||||
|
lng <n> Longitude
|
||||||
|
@*/
|
||||||
|
that.getCenter = function() {
|
||||||
|
var center = self.map.getCenter();
|
||||||
|
return {lat: center.lat(), lng: center.lng()};
|
||||||
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
getKey <f> getKey
|
getKey <f> getKey
|
||||||
() -> <o> get key
|
() -> <o> get key
|
||||||
|
@ -1579,6 +1590,18 @@ Ox.Map = function(options, self) {
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@
|
||||||
|
setCenter <f> Set map center
|
||||||
|
(center) -> <o> Map
|
||||||
|
center <o> Map center
|
||||||
|
lat <n> Latitude
|
||||||
|
lng <n> Longitude
|
||||||
|
@*/
|
||||||
|
that.setCenter = function(center) {
|
||||||
|
self.map.setCenter(new google.maps.LatLng(center.lat, center.lng));
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
value <f> value
|
value <f> value
|
||||||
(id, key, value) -> <o> set id, key to value
|
(id, key, value) -> <o> set id, key to value
|
||||||
|
|
Loading…
Reference in a new issue