Skip to content

[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

js
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 ​

NameTypeDescription
Mapanymap object
Typesstring []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 ​

NameTypeDescription
Mapanymap object
LayerListany []Layer List
key?` StringAPI key or token for accessing tile layers
providers?` AnySpecify 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 ​

NameTypeDescription
Lnganylongitude
Latanylatitude

Returns ​

Object

Converted latitude and longitude

NameType
latnumber
lngnumber

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 ​

NameTypeDescription
Lnganylongitude
Latanylatitude

Returns ​

Object

Converted latitude and longitude

NameType
latany
lngany