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
  • fitBounds
  • getBounds
  1. API & COMPONENT
  2. Maps
  3. Map Control

Bounds

fitBounds

mapInstance.fitBounds(bounds, opt);

Parameters

Parameter (Required)
Description
Remark

bounds

Center these bounds in the viewport and use the highest zoom level up to and including the map.

JSON

Parameter (Optional)
Description
Remark

padding

The amount of padding in pixels to add to the given bounds.

Numeric

linear

If true, the map transitions using Map#easeTo. If false, the map transitions using Map#flyTo.

Bool

maxZoom

The maximum zoom level to allow when the map view transitions to the specified bounds.

Numeric

Returns

Parameter
Description
Remark

Example

let bounds = {
        sw: {lat: 37.457464, lng: 126.899302},
        ne: {lat: 37.645804, lng: 127.161728}
}

let opt = {
	padding: {
           top: 5,
           bottom: 5,
           right: 15,
           left: 15
	},
	linear: true, 	    // true for “easeTo” false for “flyTo”
	maxZoom: 10
}

let opt2 = {
	padding: 10	        // 10 for top, bottom, right, and left.
}

mapInstance.fitBounds(fit, opt);
mapInstance2.fitBounds(fit, opt2);

getBounds

mapInstance.getBounds();

Parameters

Parameter (Required)
Description
Remark

Returns

Parameter
Description
Remark

Intercardinal coordinates (ne, sw) with latitude and longitude

Example

mapInstance.getBounds();
return : {
        ne : {lat: 37.645804, lng: 127.161728}
        sw : {lat: 37.457464, lng: 126.899302}
}

PreviousSourcesNextZoom

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