The lightning Map component enables the application devolpers to easily integrate MAP capability with their business application. It leverages Google Map (service fee) or leaflet Open Street Map (free) to provide data map-based interaction. Currently the leaflet based map component is ready for production usage. The Google map is in development.
<c:zyz_map type="leaflet" currentGeoLocation="{!v.currentGeo}" markers="{!v.markers}"/>
markers: a list of marker object
currentGeoLocation: GEO location used to center the MAP. currently it is not used.
type: google, leaflet. default to "leaflet"
googleApiKey: your google map API key
point: the x, y position relative to the map container
data: A object literal binded to the Marker
{
'lat': latitude,
'lng': longitude,
'html': if empty, no popup is binded to the marker on the map.
'data': object literal of the data object that you want to bind to each marker.
}
<aura:handler name="zyzMapMarkerClickEvent" event="c:zyz_map_marker_click_event"
action="{!c.onMarkerClick}"/>
onChangeMarkers: function(cmp, evt,h){
console.log(evt.getParams());
},
We have customized the marker icon to cotain a label with length <= 3 characters inside the SVG. The map will try to align the label in the central place with the label length.
Currently we only support leaflet open street map integration. we are working on Google MAP integration. And will be included in the next release.