zoomIn, zoomOut, und centerHere implemen
This commit is contained in:
16
.gitignore
vendored
16
.gitignore
vendored
@@ -1 +1,15 @@
|
||||
node_modules
|
||||
# Node modules
|
||||
/node_modules/
|
||||
|
||||
# .NET build output
|
||||
/.next/
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
BIN
.next/cache/webpack/client-development/3.pack.gz
vendored
BIN
.next/cache/webpack/client-development/3.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/client-development/index.pack.gz
vendored
BIN
.next/cache/webpack/client-development/index.pack.gz
vendored
Binary file not shown.
Binary file not shown.
BIN
.next/cache/webpack/server-development/1.pack.gz
vendored
BIN
.next/cache/webpack/server-development/1.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/index.pack.gz
vendored
BIN
.next/cache/webpack/server-development/index.pack.gz
vendored
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -153,7 +153,7 @@
|
||||
/******/
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "0f7a0a107ffd3df9"; }
|
||||
/******/ __webpack_require__.h = function() { return "4146aa11c7c552df"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/global */
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -22,7 +22,14 @@ const MapComponent = () => {
|
||||
initialMap.on("contextmenu", (event) => {
|
||||
L.popup()
|
||||
.setLatLng(event.latlng)
|
||||
.setContent('<p><button onclick="zoomIn()">Zoom in</button></p>')
|
||||
.setContent(
|
||||
`
|
||||
<p>
|
||||
<button onclick="zoomIn()">Zoom in</button>
|
||||
<button onclick="zoomOut()">Zoom out</button>
|
||||
<button onclick="centerHere(${event.latlng.lat}, ${event.latlng.lng})">Hier zentrieren</button>
|
||||
</p>`
|
||||
)
|
||||
.openOn(initialMap);
|
||||
});
|
||||
|
||||
@@ -30,6 +37,14 @@ const MapComponent = () => {
|
||||
initialMap.zoomIn();
|
||||
};
|
||||
|
||||
window.zoomOut = () => {
|
||||
initialMap.zoomOut();
|
||||
};
|
||||
|
||||
window.centerHere = (lat, lng) => {
|
||||
initialMap.panTo(new L.LatLng(lat, lng));
|
||||
};
|
||||
|
||||
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||
attribution:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
|
||||
Reference in New Issue
Block a user