Files
pygeoapi/speckle_demos/demo_leaflet_comments.html
T
KatKatKateryna 3f42069d9e Kate speckle poc (#5)
* Revert "change port"

This reverts commit 92e0b0da9e.

* better map size

* render pretty basemap if API key is available

* page layout

* better error message; all redirects to a new tab

* neat tables

* upd readme

* api key variable

* remove manual zoom setting

* reply on speckle_type for traversal

* receive custom attributes

* fix attributes

* fixes

* fixed deserialization; default color

* assign all props to all elements

* send complete displayValues for Meshes

* refactor

* more refactor

* last fixes

* use 3 dimensions

* support ICurves and new GisFeatures, and (possible) hatches

* fix hatches

* fix orientation function

* fix orientation for mesh, brep, hatch, polygon

* patch deserializer

* accept vertical polygons

* prioritize mesh colors, if available

* clean url arguments

* color mesh by 2 pts

* Revert "color mesh by 2 pts"

This reverts commit 0d2c12db1d.

* query comments and attachments

* fix time formatting

* fixed comments

* fix threads

* patch before launch

* separate comments and geometry in displayProperties

* add url parameter for data type

* split features by type

* max zoom for tiles to load

* cors

* rename url

* typo

* leaflet_demo_comments

* url fix

* Demo with masterplan

* openlayers demo, no zoom extents

* openLayers example

* Update README - QGIS WFS

* explicit error for deprecated data

* move around

* Update README.md

* better openLayers demo

* Update README.md

* Update README.md

* Update README.md

* better display colors

* attribution

* no print

* explode meshes. todo: URL param; fix Revit

* some improvements

* preserveAttributes parameter

* fix

* proper comment resource_id

* add map to empty page

* sort by height

* remove print

* page description

* page description complete

* change port
2024-08-27 19:59:29 +08:00

62 lines
2.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Leaflet demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
</head>
<body>
<main style="margin-left: 20px;margin-right: 20px;">
<div class="row">
<h3>Speckle pygeoapi demo: fetch comments</h3>
</div>
<div>
<div class="row">
<div id="items-map" style="min-height: 80vh;"></div>
</div>
</div>
</main>
<script>
var map = L.map('items-map').setView([ 45 , -75 ], 5);
map.addLayer(new L.TileLayer(
'https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 22,
attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a> &copy; Data: <a href="https://speckle.systems/">Speckle Systems</a>'
}
));
(async () => {
const speckle_data = await fetch('https://geo.speckle.systems/?speckleUrl=https://app.speckle.systems/projects/344f803f81/models/5582ab673e&datatype=projectcomments', {
headers: {
'Accept': 'application/geo+json'
}
}).then(response => response.json());
speckle_layer = L.geoJSON(speckle_data, {
filter: (feature) => {
return feature.displayProperties["object_type"] == "comment"
},
pointToLayer: (feature, latlng) => {
return new L.marker(latlng)
},
onEachFeature: function (feature, layer) {
var html = '<span><td><p>' + feature['properties']['text_html'] + '</p></td> </span>';
layer.bindPopup(html);
}
});
speckle_layer.addTo(map);
map.fitBounds(speckle_layer.getBounds())
})();
</script>
</body>
</html>