Events and Handlers
The Google Map component has the following events and handlers available for use:
Events
Event
|
Description
|
On Before Mount
|
Triggers immediately before the component is mounted and appeared on the page.
|
On Mounted
|
Triggers immediately after the component is mounted and appeared on the page.
|
On Before Unmount
|
Triggers immediately before the component is unmounted and destroyed. Perform any necessary cleanup in this method, such as invalidating timers or cleaning up any RT subscriptions that were created in this component.
|
On Visibility Change
|
Gets activated when the visibility state of the component is altered. You can use this event to define actions that need to take place when the component becomes visible or hidden.
|
On Zoom Event
|
Triggers when the user zooms in our out.
|
On Pan Event
|
Triggers when the user moves the map around (pans).
|
On Rotate Control Assignment
|
Determines if the map rotate control should be visible. This control applies to the street view and lets the user to rotate the street view. Return true to display the control.
|
On Marker Click Event
|
This event is triggered when the user clicks the marker on the map.
|
Handlers
Handler
|
Description
|
Class List Logic
|
This logic involves modifying the CSS classes associated with the component dynamically.
|
Styles Logic
|
Allows you to change the styles of the component dynamically.
|
Visibility Logic
|
Allows controlling the visibility of the component based on certain conditions. You can use this event to show or hide the component depending on user actions or other factors. If the handler returns true , the component will be visible.
|
Map Type Logic
|
Allows selecting a specific type of the map ('roadmap', 'satelite', 'hybrid', 'terrain').
|
Zoom Level Logic
|
Set's the zoom level of the map. Acceptible values are in the range between 1 (World) and 20 (Buildings).
|
Map Center Logic
|
Sets the center coordinates of the map. To set the map's cetner, return an object with the 'lat' and 'lng' properties containing the latitude and longitude values of the point.
|
Zoom Control Logic
|
Determines if the zoom controls (+/-) should be visible. Return false to hide zoom control.
|
Map Type Control Logic
|
Determines if the map type control should be visible. If the handler returns true the map type control is displayed.
|
Scale Control Logic
|
Determines if the scale control should be visible. Return true to display the control.
|
Street View Control Logic
|
Determines if the street view control should be visible. Return true to display the control.
|
Fullscreen Control Logic
|
Determines if the full screen control should be visible. Return true to display the control.
|
Show Traffic Logic
|
Determines if the traffic should be visible. Return true to display the traffic.
|
Scroll Wheel Logic
|
Determines if zooming on the map using a mouse scroll wheel. Return true to make sroll wheel available.
|
Gesture Handling Logic
|
Determines the gesture handling logic. Return 'cooperative', 'greedy', 'auto' or 'none' to change gesture handling mode.
|
Markers Logic
|
Allows adding points on the map which should have markers. The handler should return a list of objects, where each object has the 'lat' and 'lng' properties with the corresponding latitude and longitude values.
|