Тема: Map layers
Hey all
You can add custom map layer to application. We added special resource settings for it.
1. First of you have to find map. We'll use Esri.WorldImagery in this sample. We need server URL and layer parameters to continue:
// server URL
https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
// parameters
{
"attribution": "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
}
2. Open Maps tab in Hecterra and press "Add" button
3. Fill layer form
- Title - layer name (will be shown in app)
- URL - server URL (we get it on previous step)
- Tile layer / WMS - tile layer type. It depends on server type, if you're not sure - try both
- Overlay - layer will be shown above other layers (useful for cadastre or traffic layer)
- Parameters - JSON, Leaflet TileLayer Options. In this sample we use it to set attribution
4. Save setting and lets check. You can select new "Custom layer" on map.
To make configuration more comfortable we added import/export feature. Here's import config of previous example
[
{
"title": "Custom layer",
"url": "[url]https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}[/url]",
"params": {
"attribution": "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
}
}
]