API DOCUMENTATION

Marker
Created a marker on the map using the specified option.To display markers, you can set coordinate value, marker icons and icon sizes.

new fatosmap.maps.Marker({ option })

Parameter : Marker

Required Parameter Description
position Set the latitude,longitude{lat: ,lng: }
map Map object to display the marker.

Optional Parameter Description
icon Set the image of marker, type is url
iconSize Set size of marker icon, Default Fatos Bus Icon, [number,number]
message Set the message of popup, type is string
anchor(popup) * if set the message of popup
A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker#setLngLat . Options are 'center' , 'top' , 'bottom' , 'left' , 'right'.
default bottom
offset(popup) * if set the message of popup
The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up.
default 15
closeButton(popup) * if set the message of popup
If true , a close button will appear in the top right corner of the popup.
default false
closeOnClick(popup) * if set the message of popup
If true , the popup will closed when the map is clicked.
default false
addMarkerEvent You can give the marker a promised event.
(dragstart/drag/dragend)
drag A boolean indicating whether or not a marker is able to be dragged to a new position on the map.

[ example : Marker ]

** Single Create Marker **
let marker = new fatosmap.maps.Marker({
    position: {lat: 37.5651745 , lng: 126.9858103 },
    map: mapInstance,
    icon: image(My Image),
    message: 'Fatos',
    anchor : 'bottom',
    offset : 15,
    closeButton: true,
    closeOnClick: true,
    drag: true,
    addMarkerEvent: [ {event:event name, callback function } ]
});
** Multi 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
Clears the markers shown on the map.

[ example ] 

marker.setMap(null)