MOGOS Maps
console
  • Overview
  • API & COMPONENT
    • Maps
      • Map Control
        • Sources
        • Bounds
        • Zoom
        • Center
        • Rotate
        • Tilt
        • Flyto
        • Solid
        • Languages
        • Theme
        • Event Once
        • Event On/Off
      • Layer Control
        • Layers
        • Filters
        • Property
        • The specifation of layer style
          • Fill
          • Line
          • Circle
          • Symbol
      • Map UI
      • Map Utilities
        • Rectangle
        • Circle
        • Polyline
        • Polylgon
        • Area
        • Distance
        • Marker
          • Members
    • Search
      • Name
      • Category
      • Address
      • Postal Code
      • Geocoding
    • Route
      • General Vehicles
      • Motorbike
      • Bicycle
      • Pedestrian
      • Truck
      • Public Transportation
    • Logistics & Delivery
      • Route including multiple waypoints
      • Route as optimized order for multiple waypoints
      • Route as optimized order for transportation of logistics
      • Route as optimized order for delivery
      • Predicted route which is certain time in the future
    • Fleet Management
      • Realtime location tracking
      • Moving trajectory analysis
      • Driving road pattern analysis
      • Driver behavior analysis
      • Geofencing
      • Road snap
  • Help
    • Get your API Key
    • Troubleshooting
  • The last versions
    • MOGOS Maps API
      • MOGOS Maps API V1.0
Powered by GitBook

©MOGOS 2023

On this page
  • setFilter
  • getFilter
  • moveLayer
  • removeLayer
  1. API & COMPONENT
  2. Maps
  3. Layer Control

Filters

setFilter

map.setFilter(layerId, filter);

Parameters

Parameter (Required)
Description
Remark

layerID

The ID of the layer to which the filter will be applied.

String

filter

Filters control which features a style layer renders from its source.

Array | null

Returns

Parameter
Description
Remark

Example

// display only features with the 'name' property 'USA'
map.setFilter('my-layer', ['==', ['get', 'name'], 'USA']);
// remove the filter for the 'my-layer' style layer
map.setFilter('my-layer', null);

getFilter

map.getFilter(layerId);

Parameters

Parameter (Required)
Description
Remark

layerID

The ID of the style layer whose filter to get.

String

Returns

Parameter
Description
Remark

Example

const filter = map.getFilter('myLayer');e

moveLayer

map.moveLayer(id, beforlayerID)

Parameters

Parameter (Required)
Description
Remark

id

The ID of the layer to move.

String

beforeLayerID

The ID of an existing layer to insert the new layer before. When viewing the map, the id layer will appear beneath the beforeId layer.

String

Returns

Parameter
Description
Remark

Example

map.moveLayer('3d_building-kor', 'landuse');

removeLayer

map.removeLayer(id);p

Parameters

Parameter (Required)
Description
Remark

id

ID of the layer to remove.

String

Returns

Parameter
Description
Type

Example

// Some code

PreviousLayersNextProperty

Last updated 2 years ago

The MOGOS Maps API requires an API Key, which can be obtained from the website or contact .

MOGOS Console
sales@mogoscorp.com