jperelli / vue2-leaflet-markercluster

markercluster plugin extension for vue2-leaflet package
MIT License
132 stars 55 forks source link

How to build a CDN version of the Leaflet markercluster plugin for Vue? #49

Open johanneeriksson opened 3 years ago

johanneeriksson commented 3 years ago

I have been tumbling around with npm and webpack to get a plain JS file to include without any success.

The Vue2 Leaflet docs provide a CDN version that is easy to implement. https://vue2-leaflet.netlify.app/quickstart/#installation

How is it possible get a plain JS file for the cluster plugin to use with Vue?

Then this would be possible in a simple HTML file:

<link rel="stylesheet" href="//unpkg.com/leaflet/dist/leaflet.css" />
<script src="//unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="//unpkg.com/vue2-leaflet"></script>
<script src="//unpkg.com/vue2-leaflet-markercluster"></script>

Then register components:

    Vue.component('v-map', window.Vue2Leaflet.LMap);
    Vue.component('v-tilelayer', window.Vue2Leaflet.LTileLayer);
    Vue.component('v-marker', window.Vue2Leaflet.LMarker);
    Vue.component('v-marker-cluster', window.Vue2LeafletMarkercluster);
jmiguelv commented 3 years ago

@johanneeriksson have you been able to figure this out? I have tried several config options as well, but with no luck? Thank you.

quentin-aslan commented 2 years ago

Any news?

qsinger commented 1 year ago

Any news ?

pablosalazarbr commented 6 months ago

I am facing same issue, it seems like there is an issue trying to import everything using a cdn. Please let me know if someone was able to figure this out (I will update this in case I find something).