SZ2000
#Suzhou 2000 support
Suzhou 2000 supports expansion and supports Suzhou 2000 vector service, Suzhou 2000 raster service, Suzhou 2000 GeoJSON data, Suzhou 2000 3D model and 3DTiles service loading.
Suzhou 2000 coordinate conversion
Mapmost SDK for WebGL only supports the input and output of SDK coordinates. For Suzhou 2000 coordinate data, a conversion tool between Suzhou 2000 coordinates and SDK coordinates is provided.
Usage
Suzhou 2000 to SDK coordinate interface:
mapmost.Convert.fromDefinedProj();
SDK coordinates to Suzhou 2000 interface:
mapmost.Convert.toDefinedProj();
Case
//SDK center point coordinate calculation
let center = mapmost.Convert.fromDefinedProj([342171.097900000400841, 665836.627800000831485]);
//Map initialization
let map = new mapmost.Map({
container: "map", // map container id
style: "http://******/mms-style/color_pub_suzhou2000.json", //sz2000 style file
center: center, //Coordinates of the initial center point of the map
zoom: 13, // Initial zoom level of the map
pitch: 60, // Map initial pitch angle
bearing: 0, // initial azimuth of the map
userId: "***", // Authorization code
});
Reference example Map Initialization.
Suzhou 2000 Vector Service
Suzhou 2000 Vector Service Release
Using Mapmost Studio, select "Suzhou 2000" when publishing.
Suzhou 2000 vector service loading
Case
map.addSource('nature', {
type: 'vector',
url: 'http://******/MapmostProxy/sip_nature_sz2000PC.json'
});
map.addLayer({
id: 'green_park_g',
type: 'fill',
source: 'nature',
'source-layer': 'green_park_g',
paint: {
'fill-color': 'rgba(209, 230, 180, 1)',
},
});
Reference example Load vector tile service.
Suzhou 2000 Grid Service
Provides the map.addRasterLayer2 interface to load the raster service of the Suzhou 2000 coordinate system.
- Set the model coordinate system parameters project:'SZ2000'.
Case
//Load WMTS raster service
let wmts_option = {
id: "wmts-test-layer",
project: "SZ2000",
source: {
tiles: ["http://******/CIC/SIPGIS/esri-tile/layerTileService/SZ2000_sipmap/rest/services/MapServer/tile/{z}/{y}/{x}"],
origin: [-5273200, 7202100],
resolutions: resolutions
}
};
map.addRasterLayer2(wmts_option);
Reference example Load WMTS service.
Suzhou 2000 GeoJSON data
Provides the mapmost.Convert.convertGeojson() interface to convert Suzhou 2000 GeoJSON data into SDK coordinate GeoJSON data.
Case
fetch("http://../data/sz2000.geojson")
.then((res) => res.json())
.then((response) => {
map.addSource("someid", {
type: "geojson",
data: mapmost.Convert.convertGeojson(response),
});
map.addLayer({
id: "3d-buildings",
source: "someid",
type: "fill-extrusion",
paint: {
"fill-extrusion-color": "#aaa",
"fill-extrusion-height": 300,
"fill-extrusion-opacity": 0.8,
},
});
});
Reference example Load GeoJSON data.
Suzhou 2000 3D model
Load the Suzhou 2000 3D model through the map.addLayer(type:'model') interface.
- The model center point coordinates need to be converted into SDK coordinates.
- Set the model coordinate system parameters project:'SZ2000'.
Case
let center = mapmost.Convert.fromDefinedProj([339369.1795162731, 666472.346498875]);
let options = {
id: 'model_id',
type: 'model',
project:'SZ2000',
models: [{
type: 'glb',
url: './SM_DFZM_test.glb',//Suzhou 2000 three-dimensional model
}],
center: center,
};
map.addLayer(options);
Reference example Load 3D model.
Suzhou 2000 3DTiles Service
Load Suzhou 2000 3DTiles data through the map.addLayer(type:'3DTiles') interface.
Case
map.addLayer({
id: "tile-3d-layer",
type: "3DTiles",
data: "http://******/sz2000/tileset.json",
});
Refer to the example Load 3DTiles.
Suzhou 2000 ArcGIS Dynamic Service
Load the Suzhou 2000 ArcGIS dynamic service through the map.addArcGISDynamicLayer() interface.
- Set the model coordinate system parameters project:'SZ2000'.
Case
map.addArcGISDynamicLayer({
id: "arcgis-wms-test-layer",
project: "SZ2000", //Coordinate system
source: {
url: "http://******/cic/SIPGIS/esri-dyn/mxdService/SIPEPB_QYGH/rest/services/MapServer?",
layers: "show:0", // Displayed layers
format: "PNG", // Image format, default is PNG
transparent: true, // Whether the image is transparent, the default is true
},
});
Reference example Load ArcGIS dynamic service.
Suzhou 2000 Measurement and Calculation
Expand mapmost.Utils tool capabilities to support Suzhou 2000 measurement calculations.
Area measurement area(data)
Calculate the area of the closed surface data formed by a series of coordinates. The input data is the SDK coordinate array, the input coordinate type is 'SZ2000', and the return value unit is square meters.
mapmost.Utils.area([[[3, 5],[3, 6],······,[3, 5]]],'SZ2000')
Distance measurement distance(data)
Calculate the length of a series of coordinate data. The input data is the SDK coordinate array, the input coordinate type is 'SZ2000', and the return value unit is meters.
mapmost.Utils.area([[[3, 5],[3, 6],······]],'SZ2000')
Reference example 2D Measurement.