Map Events
The Map widget does not support touch events.
Map has the following events associated with it:
doLayout Event
This event is invoked for every widget when the widget position and dimensions are computed.
Syntax
Read/Write
Read + Write
Remarks
This event is invoked for all the widgets placed inside flex containers. This event is invoked in the order in which the widgets are added to the widget hierarchy and expect the frame property of the widget is calculated and available for use within this event.
This event is used to set the layout properties of child widgets in the relation to self and peer widgets whose layout is not yet performed.
The number of times this event invoked may vary per platform. It is not recommended to write business logic assuming that this function is invoked only once when there is a change in positional or dimensional properties. This event will not trigger when transformations are applied though widget is moved or scaled or rotated from its original location.
Example
Platform Availability
- iOS
- Android
- Windows
- SPA
onBoundsChanged Event
This event is sent when ever there is a change in the content of the map.
Syntax
Parameters
mapWidget
(Optional) Object. The widget that contains the map.
boundaryLocations
(Optional) Dictionary. See the remarks section below for the definition of this object.
Read/Write
Read + Write
Remarks
boundaryLocations is a dictionary which contains these elements:
- center : a dictionary of latitude and longitude which marks the center of the map bounds.
- northEast : a dictionary of latitude and longitude for the northeast boundary
- southWest : a dictionary of latitude and longitude for the southWest boundary
- latspan : a number. Signifies the difference in latitude between the two boundaries.
- lonspan : a number. Signifies the difference in longitude between the two boundaries.
navitagateTo should not be called within the body of this callback function. this will result in unwanted behavior in all platforms.
Example
Platform Availability
- iOS
- Android
- Windows
onClick Event
An event callback is invoked by the platform when the user performs a click action on the map and location data with “latitude” and “longitude” are passed to the callback.
Syntax
Parameters
mapwidgetid
Optional. Handle to the widget instance.
locationData
Optional. Specifies the location data of a single location following the data format of the “locationData” property on the map widget. It should support both hash and array format.
Read/Write
Read + Write
Remarks
This event is not raised if the user clicks on map pin and callout.
On SPA Windows platform, the onClick event gets fired three times because of google map issue with Windows mobile platform.
Example
Platform Availability
- Available in the IDE
- Available on all platforms.
onPinClick Event
An event callback that is invoked by the platform when a map pin is clicked, passing the selected locationdata to the callback.
Syntax
Parameters
mapwidgetid
Optional. Handle to the widget instance.
locationData
Optional. Specifies the location data of a single location following the data format of the “locationData” property on the map widget. It should support both hash and array format.
Read/Write
Read + Write
Remarks
Alerts should not be used for onPinClick event.
Example
Platform Availability
- Available in the IDE
- Available on all platforms
onMapLoaded Event
This event is sent when the map rendering is complete.
Syntax
Parameters
mapWidget
(Optional) Object. The widget that contains the map.
Read/Write
Read + Write
Remarks
- You should call the fitToBounds and setBounds methods for onMapLoaded callback.
- If you call both fitToBounds and setBounds (fitToBounds, setBounds) before navigating to the form that contains the map, the fitToBounds method takes precedence.
Example
None
Platform Availability
- iOS
- Android
- Windows
onScrollWidgetPosition Event
This event callback is invoked by the platform when the widget location position gets changed on scrolling. The onScrollWidgetPosition event returns the positional coordinates of the widget’s location with respect to the screen (screenX and screenY) and the parent container (frameX and frameY). This event is invoked asynchronously, and is not available for FlexForm widget.
Syntax
Read/Write
Read + Write
Example
Platform Availability
- Not Accessible from IDE
- Android, iOS, SPA, and Windows
onSelection Event
An event callback that is invoked by the platform when the user clicks on a callout of the Map.
Syntax
Parameters
mapwidget
Optional. Handle to the widget instance.
locationData
Optional. Specifies the location data of a single location following the data format of the “locationData” property on the map widget. It should support both hash and array format.
Read/Write
Read + Write
Remarks
On Desktop Web and SPA platforms, onSelection event is fired only for default infoWindow.
Example
Platform Availability
- Available in the IDE
- Available on all platforms