The front end can also have configuration files.
How do you have a configuration file?
The simplest is to write the configuration information in the js file, the data format can be defined as json, just read it.
There is another way, that is
Write the configuration information in a .json file and read it with jquery.
Config.json file
{
"map": {
"apipath": "//192.168.0.211/pubzy/arcgis_js_api/4.10/",
"basemaps": [
{
"title": "Vector 1",
"thumbnailUrl": "images/map/vector.gif",
"type": "tile",
"layer": "http://192.168.0.22:6080/arcgis/rest/services/GJHYDT84/MapServer"
},
{
"title": "vector",
"thumbnailUrl": "images/map/vector.gif",
"type": "dynamic",
"layer": "http://192.168.0.245:6080/arcgis/rest/services/GDHT/GDDZHT/MapServer"
},
{
"title": "image map",
"thumbnailUrl": "images/map/image map.gif",
"type": "tile",
"layer": "http://192.168.0.206:6080/arcgis/rest/services/HNJCZS/HNJCZSYXT/MapServer"
},
],
"streamLayer": "http://192.168.0.195:6080/arcgis/rest/services/stream-service-newradar/StreamServer",
"radarFeatureLayer": "http://192.168.0.100/arcgis/rest/services/Hosted/Radar_new/FeatureServer/0",
"SliderTimeGap": 15,
}
}
Then read and use in the page script:
let configJSON = '../config.json?t=' + new Date().getTime();
$.getJSON(configJSON, function (config) {
//config got it.
mapcof = config.map;
});
Export csv file Apple system and windows system can open the file directly (recommended) Export html text windows can be opened directly, Apple system needs to modify the file suffix named .xls to ope...
webpack.base.conf.js has some basic elements including, similar to the usual webapck.config.js. webpack.dev.conf.js This configuration will be used for our native development. webpack.prod.conf.js The...
cat /usr/local/nginx/conf/nginx.conf Reproduced in: https: //blog.51cto.com/wujianwei/2082604...
Compatibility handling of running project commands in different operating systems When using NODE_ENV = production to set environment variables, most Windows command prompts will be blocked, but ubunt...
The front-end controller in Spring MVC isDispatcherServlet, which inherits the abstract class HttpServlet. The front-end controller is the centralized access point of Spring MVC, and its main responsi...
Step 1: Create and connect to the service If you are not clear, you can refer to the article: Step 2: Find the nginx configuration file Command: netstat -nltp |grep port number pwdx process number...
Description: launch.json configuration file settings.json file (the terminal will not appear garbled when compiling) ...
Individual document classification Preface File classification Environment software configuration surroundings Essential extensions for Google Chrome VScode basic configuration Other commonly used sof...
webpack the goal: Learn profiles using WebPack Will specify package mode and learn about the difference between the two packages Will specify the entrance, export file Set DevTool The zero configurati...