-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
653bb1c
commit d64ac8c
Showing
4 changed files
with
148 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" | ||
/> | ||
|
||
<title>L.Geoserver</title> | ||
|
||
<style> | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
#map { | ||
width: 100%; | ||
height: 100vh; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="map"> | ||
<h1 class="leaflet-control">Leaflet L.GeoServer Plugin</h1> | ||
</div> | ||
<a href="https://github.com/iamtekson/l.geoserver" | ||
><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 1000;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a></a> | ||
|
||
<!-- <div class="wmsimage" style="float: right;"> | ||
<h2>Wms Image</h2> | ||
<img src="" alt="this is image" srcset="" id="wmsImage" /> | ||
</div> --> | ||
|
||
</body> | ||
</html> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | ||
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script> | ||
<script src="../src/L.Geoserver.js"></script> | ||
|
||
<script> | ||
|
||
var map = L.map("map", {zoomControl: false}).setView([38.861, 71.2761], 7); | ||
var osmLayer = L.tileLayer( | ||
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", | ||
{ | ||
maxZoom: 19, | ||
attribution: | ||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', | ||
} | ||
).addTo(map); | ||
|
||
//wms | ||
var wms = L.Geoserver.wms("http://tajirisk.ait.ac.th:8080/geoserver/wms", { | ||
layers: `tajikistan:EAR_Builtup`, | ||
}); | ||
wms.addTo(map); | ||
|
||
//wfs | ||
var wfs = L.Geoserver.wfs("http://tajirisk.ait.ac.th:8080/geoserver/wms", { | ||
layers: `tajikistan:jamoat`, | ||
style: { | ||
color: "red", | ||
fillOpacity: 0, | ||
opacity: 1, | ||
stockWidth: 0.5, | ||
}, | ||
onEachFeature: function (f, l) { | ||
l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); | ||
}, | ||
CQL_FILTER: `name_rg=='Sughd'`, | ||
}); | ||
wfs.addTo(map) | ||
|
||
//legend | ||
var legend = L.Geoserver.legend("http://tajirisk.ait.ac.th:8080/geoserver/wms", { | ||
layers: `tajikistan:EAR_Builtup`, | ||
}); | ||
legend.addTo(map); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" | ||
/> | ||
<title>WMSImage-L.Geoserver</title> | ||
<style> | ||
#wmsImage { | ||
padding: 30px; | ||
border: 1px solid black; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<a href="https://github.com/iamtekson/l.geoserver" | ||
><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 1000;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a></a> | ||
|
||
<div class="wmsimage"> | ||
<h2>Wms Image</h2> | ||
<img src="" alt="this is image" srcset="" id="wmsImage" /> | ||
</div> | ||
|
||
</body> | ||
</html> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | ||
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script> | ||
<script src="../src/L.Geoserver.js"></script> | ||
|
||
<script> | ||
//wmsImage | ||
var wmsImage = L.Geoserver.wmsImage( | ||
"http://tajirisk.ait.ac.th:8080/geoserver/tajikistan/wms", | ||
{ | ||
wmsLayers: [ | ||
"tajikistan:jamoat", | ||
"tajikistan:EAR_Agriculture", | ||
"tajikistan:district", | ||
], | ||
wmsCQL_FILTER: ["name_rg='Khatlon'", "INCLUDE", "name_rg=='Khatlon'"], | ||
wmsStyle: [ | ||
"INCLUDE", | ||
"tajikistan:EAR_Agriculture", | ||
"tajikistan:cql_boundary", | ||
], | ||
format: "image/png", | ||
wmsId: "wmsImage", | ||
width: 600, | ||
height: 600, | ||
transparent: true, | ||
} | ||
); | ||
</script> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters