~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Development tools and key technology: senior Supermap GIS application and secondary development
Author: li yu good
Writing time: on April 28, 2020,
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Supermap GIS which is a kind of space data acquisition, storage, update, analysis and output of tools such as, I want to talk about today is the projection coordinate system,
Why to use projection, because the earth's surface is curved, and maps are usually drawn on the plane drawings, therefore when drawing surface exhibition for the plane in the first place, however, spherical surface is not fair, in other words, it is direct show of plane, is unlikely to occur not wrinkle, use this map with wrinkles, obviously it is not the truth, so must adopt special methods will surface, making it a no fold flat, so there is a map projection theory, the principle is: because the position is determined by its latitude and longitude of a point on a sphere, so the actual projection is to some geographic intersection of plotting on the plane, then the same latitude and longitude of the point together as warp, the same latitude are points of latitude, constitute a graticule, after a graticule, it can be the points on the sphere, according to the longitude and latitude of plotting the corresponding location on the flat surface,
Simply the definition of map projection, map projection is the essence of the earth ellipsoid connection network according to certain mathematical laws to plane,
In particular, the position of the point on a sphere with geographical coordinates (latitude, longitude) in said, and the plane point position is in rectangular coordinates (abscissa ordinate x, Y) said, so if you want to transfer the point on the surface of the earth to the plane, a certain mathematical methods must be used to determine the geographic coordinates and the relationship between the plane rectangular coordinates and polar coordinates,
Established in spherical and plane between the point and the point of the function relationship between mathematical method, known as the map projection,
How to choose the projection map projection choose whether appropriate, directly affect the accuracy of the map and the practical value, with different projection method to establish the geographic mesh form of different, their deformation properties and deformation distribution also each are not identical,
In practical application, should as far as possible, minimize the deformation of map projection, which there is no way of projection transformation can complete, no deformation to express the reality of the earth's surface, should be considered when selecting a map projection in the area of cartography, shape and location and several factors such as the purpose of the map,
How to use the code implementation:
//map map, layer
Var map, layer,
//host=document. The location. The toString (). The match (/file: \ \//)? "Http://localhost:8090" : 'http://' + document. The location. The host;
Url="http://localhost:8090/iserver/services/map-chinaPOI/rest/maps/ChinaDark";
//create the map control
The function the init () {
The map=new SuperMap. The map (" map ");
//create block dynamic REST layer, the layer showed iserver map issued by the 8 c services,
//the name of "world" for the layer, layer service url address, {transparent: true}
//maxResolution set to the url of the optional parameter layer set maximum resolution layer instantiation, the default maximum is 360 c/256 pixels (projection for 4326),
//equivalent to zoom level to a level 0, maxResolution will be different under different projection, internal will be calculated,
//transparent layer is transparent, the default is false) and cacheEnabled (whether or not to use server-side cache, defaults to true)
Layer=new SuperMap. Layer. TiledDynamicRESTLayer (" ChinaDark ", url, null, {maxResolution: "auto"});
Layer. Events. On ({" layerInitialized ": addLayer});
}
The function addLayer () {
//will be loaded into the Layer Layer on the Map object
Map. AddLayer (layer);
//out of the figure, the map. The setCenter function display map
Map. SetCenter (new SuperMap. LonLat (0, 0), 0).
}