bopen / leaflet-area-selection

Create and manipulate a polygonal area on a Leaflet map
https://bopen.github.io/leaflet-area-selection/
MIT License
36 stars 14 forks source link

By clicking on the starting point, nothing happens #16

Open bardiaabasirad opened 1 year ago

bardiaabasirad commented 1 year ago

I'm having trouble completing the polygon on the map and I can't complete the polygon When I create multiple points, finally clicking on the starting point of the polygon, it doesn't complete, but I have no problem by dragging and creating a quad. My package file is like this:

    {
        "private": true,
        "scripts": {
            "dev": "vite",
            "build": "vite build"
        },
        "devDependencies": {
            "@inertiajs/inertia": "^0.11.0",
            "@inertiajs/inertia-vue3": "^0.6.0",
            "@inertiajs/progress": "^0.2.7",
            "@tailwindcss/forms": "^0.5.3",
            "@vitejs/plugin-vue": "^3.0.0",
            "autoprefixer": "^10.4.12",
            "axios": "^1.1.2",
            "laravel-vite-plugin": "^0.6.0",
            "lodash": "^4.17.19",
            "postcss": "^8.4.18",
            "tailwindcss": "^3.2.1",
            "vite": "^3.0.0",
            "vue": "^3.2.41"
        },
        "dependencies": {
            "@bopen/leaflet-area-selection": "^0.7.0",
            "flickity": "^3.0.0",
            "leaflet": "^1.9.2",
            "leaflet-control-geocoder": "^2.4.0",
            "leaflet.markercluster": "^1.5.3",
            "vue-number-format": "^1.3.1"
        }
    }

Animation5


    <script setup>    
    import {onMounted} from 'vue'; 
    import L from "leaflet";
    import '@bopen/leaflet-area-selection/dist/index.css';
    import { DrawAreaSelection } from "@bopen/leaflet-area-selection";

    onMounted(() => {
        let map = L.map('map').setView([34.072252465689886, 47.97370332895173], 16);
        L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png',{
            maxZoom: 18
        }).addTo(map);

        const areaSelection = new DrawAreaSelection({
            active: true,
            fadeOnActivation: false
        });

        map.addControl(areaSelection);
    })    
    </script>

    <template>        
        <div id="map" class="min-h-screen"></div>              
    </template>
keul commented 1 year ago

Unluckily the dev env of this project needs some love (I wrongly bet on the bad horse and used a build tool which is now unmaintained). This just to say: I don't think I will find the time to inspect this issue in the short term.

Going back to issue itself: some important questions follows.

keul commented 1 year ago

Ah sorry, missed your package.json above.

I never tested this with leaflet 1.9. I tried to test it, but failed for the issue I introduce above. I have to check this…

bardiaabasirad commented 1 year ago

peace be upon you npm v9.4.2 and Node v18.14.0 are used in this project

keul commented 1 year ago

Yep, reported by email from another user:

I tried all the LTS node.js versions. All the builds with node versions above 14.19 fail. When built with 16 LTs or 18, it will create the issues explained before.

This is the issue I was talking about. I have to drop microbundle-crl from the env to fix this.