バウンディングボックス
バウンディングボックスとは地図上の特定の領域を記述するための仕組みです。こ れは通常、 座標対の配列 と し て表現 さ れ、 第1座標対は枠の南西隅(経度 と 緯度の最小値)を指し、第2座標対は枠の北東隅(経度と緯度の最大値)を指します。
この Mapbox GL JS のサンプルでは、LngLatBounds
メソッド(英語)を使用してバウンディングボックスを作成します。
const southWest = new mapboxgl.LngLat(-73.9876, 40.7661);
const northEast = new mapboxgl.LngLat(-73.9397, 40.8002);
const boundingBox = new mapboxgl.LngLatBounds(southWest, northEast);
関連ページ(英語)
マップを作成したりジオコーディング リクエストを開始するMapboxライブラリには、コードでバウンディング ボックスを使用するためのクラスまたはオブジェクトがあります。
- Mapbox Geocoding API
bbox
parameter documentation - Mapbox.js
L.LatLngBounds
documentation - Mapbox GL JS
LngLatBounds
documentation - Mapbox Maps SDK for iOS
CoordinateBounds
documentation - Mapbox Maps SDK for Android
CoordinateBounds
class documentation - Mapbox Java SDK
MapboxGeocoding.Builder.bbox()
method documentation - MapboxGeocoder.swift
RectangularRegion
class documentation - Turf.js
turf.bbox
documentation