浏览代码

Some GeoJSON fixes

Maurits van der Schee 5 年前
父节点
当前提交
fb5ad7a3f9
共有 2 个文件被更改,包括 34 次插入0 次删除
  1. 1
    0
      api.php
  2. 33
    0
      examples/clients/leaflet/vanilla.html

+ 1
- 0
api.php 查看文件

@@ -7717,6 +7717,7 @@ $config = new Config([
7717 7717
     'username' => 'php-crud-api',
7718 7718
     'password' => 'php-crud-api',
7719 7719
     'database' => 'php-crud-api',
7720
+    'controllers' => 'records,geojson',
7720 7721
 ]);
7721 7722
 $request = RequestFactory::fromGlobals();
7722 7723
 $api = new Api($config);

+ 33
- 0
examples/clients/leaflet/vanilla.html 查看文件

@@ -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/leaflet@1.5.1/dist/leaflet.css"/>
12
+    <script src="https://unpkg.com/leaflet@1.5.1/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>

正在加载...
取消
保存