Getting started with iClient for Leaflet |
SuperMap iClient for Leaflet development process is as follows:
Figure 1 SuperMap iClient for Leaflet development process
The following demonstrates how to use SuperMap iClient for Leaflet to construct a simple map application.
Gitee: https://git.oschina.net/isupermap/iClient9
Figure 2 SuperMap iClient Javascript package structure
Create a new folder in a disk and named as "MyFirst"; In the "MyFirst” folder, use a text editor (such as NotePad++) to create a "GettingStarted.html" html page. And save the html to UTF-8 encoding. Add the following codes to it:
HTML |
|
---|---|
<!DOCTYPE html> |
Copy the iclient9-leaflet.js to "MyFirst" folder:
Add the following codes to <html> and <body> to implement the function of creating the map.
JavaScript |
|
---|---|
<head> |
Add the following codes to <body> to implement the function of creating the map.
JavaScript |
|
---|---|
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;"> |
Run SuperMap iServer and the GettingStarted.html file to browse the map data.
Figure 3 Access SuperMap iServer service world map