new UWA.Controls.Map(options)
Display a Google Map.
Available Events
| Event | Description |
|---|---|
onPreInject |
Triggered before inject |
onPostInject |
Triggered after inject |
onResize |
Invoked when control needs to resize |
onLoad |
Invoked when the map is loaded |
Example
var onMapLoad = function() {
MyMap.setPosition({
coords: {
latitude: 42.123,
longitude: 42.123
}
});
};
var MyMap = new UWA.Controls.Map({
events: {
onLoad: onMapLoad
}
});
Parameters
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options hash or a option/value pair. Properties
|
Extends
- UWA.Controls.Abstract
Mixes In
- UWA.Classes.Timed
Index
Members
Methods
Members
-
<protected> id
-
Properties:
Name Type Description idNumber Instance unique id.
-
<protected> api
-
Properties:
Name Type Description apiObject The current google.maps object.
-
<protected> map
-
Properties:
Name Type Description mapObject The current google.maps.Map instance.
-
<protected> defaultOptions
-
Properties:
Name Type Description defaultOptionsObject The default controls options.
Methods
-
callApi(callback)
-
To be sure the google map api is loaded, you must wrap all your calls in this method if the api is not loaded, this method will try a bit later
Parameters
Name Type Description callbackFunction Executed once the api is fully loaded
-
setPosition(position)
-
Set Center of the Map to a position.
Parameters
Name Type Description positionObject A position object with coords object attribute with longitude and latitude
-
setSize(size)
-
Change the size of the map.
Parameters
Name Type Description sizeObject an object with
widthandheightproperties, matching the width and height style values. -
addMarker(position, title, content)
-
Add a marker on the Map to a position.
Parameters
Name Type Description positionObject A position object with coords object attribute with longitude and latitude
titleString Marker title
contentString Marker content (could contain HTML)
-
onApiReady()
-
Invoked when google Api is loaded
-
onLoad()
-
Triggered after google Api is loaded
-
onResize()
-
Invoked when control needs to resize