FATOS Developer
Developer SiteConsole
  • FATOS Developer Introduction
  • FATOS API
    • Map
      • Map control
        • Sources
        • Layers
          • Style Specification
            • Fill
            • Line
            • Symbol
            • Circle
        • Building
        • Bounds
        • Center
        • Heading
        • Flyto
        • Tilt
        • Zoom
        • Marker
          • Instance Members
        • Polyline
        • Polygon
        • Circle
        • On/Off
        • Once
        • Language
        • Theme
        • Cluster
          • Instance Members
      • Button control
      • Utilities
        • Rectangle
        • Distance
        • Area
    • Search
      • Address
      • Geocoding
      • Geofencing
      • Detail
      • Public Transport
        • Bus Route
        • Bus Route Information
        • Bus Stop Information
        • Subway Station Information
        • Subway Station Timetable
        • Public Transit POI within Radius
        • Public Transit POI on Map
        • Subway Station Transfer Information
        • Real-time Bus Location Information
        • Real-time Bus Arrival Information
    • Routing
      • Route
      • Route for truck
      • Route_v2
      • Public Transit Route Search
      • Route Graphic Data
      • Bicycle
      • Pedestrian
    • Analyze
    • Tracking
  • FATOS SDK
    • Authentication
    • Platform
      • Android
        • Start
        • Component
      • iOS
        • Start
        • Component
      • React Native
        • Start
        • Component
  • Get your API Key
  • Release Note
    • FATOS Map API
    • API Server
    • RP Server
  • Troubleshooting
    • FAQ
Powered by GitBook
On this page
  • getId()
  • setLngLat(markerId, lnglat)
  • getLngLat(markerId)
  • setMessage(markerId, message)
  • setZIndex(markerId, index)
  • getZIndex(markerId)
  • setOffset(markerId, offset)
  • getOffset(markerId)
  • setDraggable(markerId, bool)
  • isDraggable(markerId)
  • setPopupOffset(markerId, offset)
  • getPopupOffset(markerId)
  • togglePopup()

Was this helpful?

  1. FATOS API
  2. Map
  3. Map control
  4. Marker

Instance Members

getId()

Get the marker's id.

// one marker 
marker.getId();

// markers
let ids = [];
for(let i = 0; i < markers.length; i++) {
    ids.push(markers[i].getId());
}
console.log('Ids :', ids);

setLngLat(markerId, lnglat)

Set the marker's geographical position and move it.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

lnglat

Latitude and longitude {lat, lng}

Object

const lnglat = { lat: 37.482630, lng: 126.899893};
marker.setLngLat(markerID, lnglat);

getLngLat(markerId)

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

Get the marker's geographical location.

const lnglat = marker.getLngLat(markerID);
console.log(lnglat);

setMessage(markerId, message)

Sets the popup's content to a string of text.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

message

The message you want to show on the marker.

HTML

const message = `<div>Change Message</div>`;
marker.setMessage(id, message);

setZIndex(markerId, index)

Change the marker's Z-lndex.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

index

The z-index CSS property sets the z-order of a positioned element and its descendants or flex items.

Numeric

marker.setZIndex(markerID, index);

getZIndex(markerId)

Get the marker's Z-lndex.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

marker.getZIndex(markerID);

setOffset(markerId, offset)

Sets the offset of the marker.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

offset

Move the selected element to a specific location.

Array<numeric>

const offset = [0, -20];
marker.setOffset(markerID, offset);

getOffset(markerId)

Get the marker's offset.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

marker.getOffset(markerID);

setDraggable(markerId, bool)

Sets the draggble property and functionality of the marker.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

bool

Whether to move by clicking on the marker.

boolean

const bool = true;
marker.setDraggable(markerID, bool);

isDraggable(markerId)

Returns true if the marker can be dragged.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

marker.isDraggable(markerID);

setPopupOffset(markerId, offset)

Sets the Popup offset of the marker.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

offset

Move the selected element to a specific location.

Array<numeric>

const offset = [0, -20];
marker.setPopupOffset(markerID, offset);

getPopupOffset(markerId)

Get the marker's Popup offset.

Required Parameter

Description

Type

markerID

The ID that created the marker.

String

marker.getPopupOffset(markerID)

togglePopup()

Opens or closes the Popup instance that is bound to the Marker, depending on the current state of the Popup.

// marker
marker.togglePopup();

// markers
markers[i].togglePopup();
PreviousMarkerNextPolyline

Last updated 3 years ago

Was this helpful?