eine Beispiel Marker einfügen und entferne Standard-Zoomsteuerung
This commit is contained in:
BIN
.next/cache/webpack/client-development/0.pack.gz
vendored
BIN
.next/cache/webpack/client-development/0.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/client-development/1.pack.gz
vendored
BIN
.next/cache/webpack/client-development/1.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/client-development/2.pack.gz
vendored
BIN
.next/cache/webpack/client-development/2.pack.gz
vendored
Binary file not shown.
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/0.pack.gz
vendored
BIN
.next/cache/webpack/server-development/0.pack.gz
vendored
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/2.pack.gz
vendored
BIN
.next/cache/webpack/server-development/2.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/3.pack.gz
vendored
BIN
.next/cache/webpack/server-development/3.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/4.pack.gz
vendored
BIN
.next/cache/webpack/server-development/4.pack.gz
vendored
Binary file not shown.
BIN
.next/cache/webpack/server-development/5.pack.gz
vendored
BIN
.next/cache/webpack/server-development/5.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
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"/_app": "pages/_app.js",
|
||||
"/_document": "pages/_document.js",
|
||||
"/_error": "pages/_error.js",
|
||||
"/_document": "pages/_document.js",
|
||||
"/": "pages/index.js",
|
||||
"/api/locations": "pages/api/locations.js"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -153,7 +153,7 @@
|
||||
/******/
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "7f1801e1af722742"; }
|
||||
/******/ __webpack_require__.h = function() { return "0f7a0a107ffd3df9"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/global */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"c":["webpack","components_MapComponent_js"],"r":[],"m":[]}
|
||||
@@ -1 +0,0 @@
|
||||
{"c":["webpack","components_MapComponent_js"],"r":[],"m":["./node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css","./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[6].oneOf[12].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[6].oneOf[12].use[2]!./node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"c":["webpack"],"r":[],"m":[]}
|
||||
@@ -11,7 +11,7 @@ self["webpackHotUpdate_N_E"]("webpack",{},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "7dfe351ff7f53003"; }
|
||||
/******/ __webpack_require__.h = function() { return "0f7a0a107ffd3df9"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ }
|
||||
@@ -11,7 +11,7 @@ self["webpackHotUpdate_N_E"]("webpack",{},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "7f1801e1af722742"; }
|
||||
/******/ __webpack_require__.h = function() { return "d498b704493928ba"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ }
|
||||
@@ -11,7 +11,7 @@ self["webpackHotUpdate_N_E"]("webpack",{},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "42d50449cc334fe1"; }
|
||||
/******/ __webpack_require__.h = function() { return "0e74aa54b34d9d23"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ }
|
||||
@@ -1,3 +1,4 @@
|
||||
"use strict";
|
||||
/*
|
||||
* ATTENTION: An "eval-source-map" devtool has been used.
|
||||
* This devtool is neither made for production nor for readable output files.
|
||||
@@ -6,19 +7,12 @@
|
||||
* or disable the default devtool with "devtool: false".
|
||||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||||
*/
|
||||
exports.id = "vendor-chunks/leaflet-contextmenu";
|
||||
exports.ids = ["vendor-chunks/leaflet-contextmenu"];
|
||||
exports.modules = {
|
||||
|
||||
/***/ "./node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css":
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css ***!
|
||||
\***********************************************************************/
|
||||
/***/ (() => {
|
||||
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
self["webpackHotUpdate_N_E"]("webpack",{},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.h = function() { return "d0630572fbbc1a10"; }
|
||||
/******/ }();
|
||||
/******/
|
||||
/******/ }
|
||||
);
|
||||
19
.next/trace
19
.next/trace
File diff suppressed because one or more lines are too long
@@ -6,19 +6,23 @@ const MapComponent = () => {
|
||||
const mapRef = useRef(null);
|
||||
const [map, setMap] = useState(null);
|
||||
|
||||
function addMarker(map) {
|
||||
const marker = L.marker([53.111111, 8.4625]).addTo(map);
|
||||
marker.bindPopup("<b>Hallo Welt!</b><br>Ich bin ein Popup.").openPopup();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (mapRef.current && !map) {
|
||||
const initialMap = L.map(mapRef.current, {
|
||||
center: [53.111111, 8.4625],
|
||||
zoom: 10,
|
||||
zoomControl: false, // Deaktiviere die Standard-Zoomsteuerung
|
||||
});
|
||||
|
||||
initialMap.on("contextmenu", (event) => {
|
||||
L.popup()
|
||||
.setLatLng(event.latlng)
|
||||
.setContent(
|
||||
'<p>Right-click menu<br/><button onclick="zoomIn()">Zoom in</button></p>'
|
||||
)
|
||||
.setContent('<p><button onclick="zoomIn()">Zoom in</button></p>')
|
||||
.openOn(initialMap);
|
||||
});
|
||||
|
||||
@@ -30,6 +34,7 @@ const MapComponent = () => {
|
||||
attribution:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
}).addTo(initialMap);
|
||||
addMarker(initialMap);
|
||||
|
||||
setMap(initialMap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user