Marker
marker(marker)
Description
Created a marker on the map using the specified option. To display markers, you can set coordinate value, marker icons and icon sizes.
Parameter
marker : object
Name | Description | Parameter | Optional |
---|---|---|---|
position | Set the latitude. | number | must ex) {lat: 37.564952, lng: 126.987321} |
map | Set the Map | Map(Instance) | must |
icon | Set the Icon | url | optional Default Fatos Bus Icon |
iconSize | Set the IconSize | [number,number] | optional Default width : 30, height :30 |
message | Set the Message Popup | String | optional Default null |
drag | Set the Marker Draggable | boolean | optional Default false |
Example
** Create Marker **
let marker = new fatosmap.maps.Marker({
position: {lat: 37.5651745 , lng: 126.9858103 },
map: mapInstance,
icon: image(My Image),
message: 'Fatos',
drag: true
});
** Create Markers **
let markers = []
let count = markers.length
let positions = [
{ lat: 37.564952 , lng: 125.987321 },
{ lat: 37.564952 , lng: 126.987321 },
{ lat: 37.564952 , lng: 124.987321 }
]
for(let i = 0; i < count; i++){
let marker = new fatosmap.maps.Marker({
position: positions[i],
map: mapInstance
})
markers.push(marker)
markers[i].setMap(mapInstance)
}
removeMarker(null)
Description
Clears the markers shown on the map.
Example
marker.setMap(null)