File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22title : Community
33---
44
5+ <link rel =" stylesheet " href =" https://unpkg.com/leaflet/dist/leaflet.css " />
6+ <script src =" https://unpkg.com/leaflet/dist/leaflet.js " ></script >
7+ <style >
8+ #map {
9+ width : 600px ;
10+ height : 200px ;
11+ }
12+ .leaflet-marker-icon {
13+ background : transparent !important ;
14+ box-shadow : none ;
15+ }
16+ </style >
17+
518# Community
619
7- <script src =" https://embed.github.com/view/geojson/geopython/pygeoapi.io/gh-pages/community/live-deployments.geojson " > </script >
20+ <div id =" map " ></div >
21+
22+ <script >
23+ const map = L .map (' map' , {
24+ attributionControl: false
25+ }).setView ([20 , 0 ], 1 );
26+
27+ L .tileLayer (' https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' , {
28+ attribution: ' © OpenStreetMap contributors'
29+ }).addTo (map);
30+
31+ const icon = L .icon ({
32+ iconUrl: ' marker.png' ,
33+ iconSize: [25 , 41 ],
34+ iconAnchor: [12 , 41 ],
35+ shadowUrl: null
36+ });
37+
38+ fetch (' https://raw.githubusercontent.com/geopython/pygeoapi.io/gh-pages/community/live-deployments.geojson' )
39+ .then (r => r .json ())
40+ .then (data => {
41+ const layer = L .geoJSON (data, {
42+ pointToLayer : (feature , latlng ) => {
43+ return L .marker (latlng);
44+ }
45+ }).addTo (map);
46+
47+ map .fitBounds (layer .getBounds ());
48+ });
49+ </script >
50+
851
952<div class =" pygeoapi-powered " >
1053 <a href =" https://www.ga.gov.au " ><img alt =" Geoscience Australia " src =" /img/org-logos/aus-ga.png " /></a >
You can’t perform that action at this time.
0 commit comments