1. Visit http://epsg.io/
2. Find the coordinate system you want to customize, take 4490 coordinate system as an example:
click Proj4js, copy the code under JavaScript;
3. Visit https://www.bootcdn.cn/ proj4js/
4. What do you use proj4js, proj4js for? The official website says there is such a word "Proj4js is a JavaScript library for converting coordinates from one coordinate system to another coordinate system, including the base conversion",
as used herein, version 2.2.2, click on "Copy the script tag,"
which This method must be connected to the Internet to succeed, otherwise an error will be reported and the map will not be loaded! So when we are not connected to the Internet, we can use the locally imported proj4.js, and we did not find the download address on the Internet, so we thought of a way to visit https://cdn.bootcdn.net/ajax/libs/proj4js /2.2.2/proj4.js
will display the js code, press ctrl+a to select all and copy, then create a new proj4.js file and paste the js code, copy proj4.js into the project for reference, OK, perfect solution!
5. Introduce proj4.js in the js file;
get the custom coordinate system and create an instance;
add the proj4 conversion method to
load the custom coordinate system layer to
test the coordinate system conversion, check the console, if there is no error, then the conversion is successful !