Skip to content

Commit fb5ad7a

Browse files
committed
Some GeoJSON fixes
1 parent bedfbba commit fb5ad7a

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

api.php

+1
Original file line numberDiff line numberDiff line change
@@ -7717,6 +7717,7 @@ public static function toString(ResponseInterface $response): string
77177717
'username' => 'php-crud-api',
77187718
'password' => 'php-crud-api',
77197719
'database' => 'php-crud-api',
7720+
'controllers' => 'records,geojson',
77207721
]);
77217722
$request = RequestFactory::fromGlobals();
77227723
$api = new Api($config);

examples/clients/leaflet/vanilla.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Quick Start - Leaflet</title>
5+
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
9+
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
10+
11+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"/>
12+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
13+
<script src="https://labs.easyblog.it/maps/leaflet-layerjson/src/leaflet-layerjson.js"></script>
14+
</head>
15+
<body>
16+
17+
<div id="mapid" style="width: 600px; height: 400px;"></div>
18+
<script>
19+
20+
var mymap = L.map('mapid').setView([20, 30], 12);
21+
22+
L.tileLayer('https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
23+
maxZoom: 18,
24+
}).addTo(mymap);
25+
26+
L.layerJSON({
27+
url: "http://localhost:8000/api.php/geojson/users?filter=location,swi,POLYGON(({lon1} {lat1},{lon1} {lat2},{lon2} {lat2},{lon2} {lat1},{lon1} {lat1}))"
28+
}).addTo(mymap);
29+
30+
</script>
31+
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)