From the WebApp directory you can see the map Mapmanager processing, so in mapmanager.js to find the way to load the map, it is easy to find the Showmap method inside: There is another method _showmap method, view the definition, Found inside is based on the configuration file inside is 3D or 2D load map, because now only with 2D so jump directly to else inside, in this _ Show2dwebmap inside is based on whether there is Itemid in the configuration file (online map corresponding ID) to load the map, the system by default will give the app a itemid, and we need to do is not itemid, with our local server data Now look at the definition and jump to the _show2dlayersmap method, which creates a map based on the mapoptions (map extent) of the profile (no map data), and then iterates through the config to create the map, view the definition, The discovery is to judge the field in the map in the configuration file, and then to create the map, where the CB (LAYERCONFIG,I) ===lang.hitch (this, function (layerconfig) and then view the definition of Createlyer () , it is necessary to add the fields and data needed to load the local data for the config file to traverse many fields in config. Now the Layerconfige is an array, because this time only with a map so you can only traverse once, see the first loop for (Var p in layerconfig) to loop keyproperties then you must first add ' label ', ' url ', ' The properties of type ', ' Icon ', ' infotemplate ', ' isoperationallayer ' are then judged by the layer's infotemplate, and you can see that some of the properties in Infotemplate have a title, Content,width,height the most important load map is to have the address, through the qualified can see, the configuration file should have a URL, So load one and then there is a bool value to which all the properties have been loaded as follows: To run the local map will be loaded on the online may go, so in the configuration file found Itemid, will he empty now run can see the results:
Modifying WebApp Basemaps