[mxcad_2d API documentation] (../README. md)/mapbox
Module: mapbox
This module contains exports related to the integration of GIS and CAD, and all exported content can be directly used by importing through the MXCAD package
Example
import { MxMapAddRasterTileLayer } from "mxcad"Table of contents
Classes
Functions
Functions
MxMapAddGoogleCnLayer
▸ MxMapAddGoogleCnLayer(map, types, urls?): void
Load Google Cloud Layer map layer, Mars coordinate system
Parameters
| Name | Type | Description |
|---|---|---|
| Map | any | map object |
| Types | string [] | Types of Google Maps Layers |
urls? | string [] | URL of Google Maps layer |
Returns
void
MxMapAddRasterTileLayer
▸ MxMapAddRasterTileLayer(map, layerList, key?, providers?): void
Load map layer
Parameters
| Name | Type | Description |
|---|---|---|
| Map | any | map object |
| LayerList | any [] | Layer List |
key? | string | API key or token for accessing tile layers |
providers? | any | Specify the provider information for the tile layer |
Returns
void
mx_gcj02_To_gps84
▸ mx_gcj02_To_gps84(lng, lat): Object
Convert the coordinates of the National Bureau of Surveying and Mapping (GCJ-02 coordinate system) to GPS coordinates (WGS 84 coordinate system)
Parameters
| Name | Type | Description |
|---|---|---|
| Lng | any | longitude |
| Lat | any | latitude |
Returns
Object
Converted latitude and longitude
| Name | Type |
|---|---|
lat | number |
lng | number |
mx_gps84_To_gcj02
▸ mx_gps84_To_gcj02(lng, lat): Object
Convert GPS coordinates (WGS 84 coordinate system) to National Bureau of Surveying and Mapping coordinates (GCJ-02 coordinate system)
Parameters
| Name | Type | Description |
|---|---|---|
| Lng | any | longitude |
| Lat | any | latitude |
Returns
Object
Converted latitude and longitude
| Name | Type |
|---|---|
lat | any |
lng | any |
