cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Blaenzo Regular Visitor
Regular Visitor

Leaflet.markercluster package in custom visual

Hi,

 

I would like to use the 'Leaflet.markercluster' package in conjuction with the Google Maps API, but I run into the following issue:

 

On a clean custom visual project I ran:

npm i leaflet@1.3.1
npm i leaflet.markercluster
npm i --save @types/leaflet.markercluster

(installation of 'leaflet@1.3.1' is required upon installation of 'leaflet.markercluster')

 

Then the line (see 'Leaflet.markercluster' package documentation)

var obj = L.masterClusterGroup();

throws the following error:

Property 'masterClusterGroup' does not exist on type 'typeof "C:/pbiviz/testproj/node_modules/@types/leaflet/index"'

I don't understand why it looks at the type script for 'leaflet' and not 'leaflet.markercluster'.

The file 'node_modules\leaflet.markercluster\dist\leaflet.markercluster.js' clearly contains 'MarkerClusterGroup'.

 

I hope someone can help. This should be easy to replicate since it is on a clean project.

 

Thanks!

Martijn

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Blaenzo Regular Visitor
Regular Visitor

Re: Leaflet.markercluster package in custom visual

Not sure why but it seems to break if either of the following packages are newer than the folling versions:

    "@types/leaflet": "^1.0.69",
    "@types/leaflet.markercluster": "^1.0.0",

Later I realized this does not work on Google Maps and decided to use a combination of:

'js-marker-clusterer' and 'OverlappingMarkerSpiderfier'

 

 

 

1 REPLY 1
Blaenzo Regular Visitor
Regular Visitor

Re: Leaflet.markercluster package in custom visual

Not sure why but it seems to break if either of the following packages are newer than the folling versions:

    "@types/leaflet": "^1.0.69",
    "@types/leaflet.markercluster": "^1.0.0",

Later I realized this does not work on Google Maps and decided to use a combination of:

'js-marker-clusterer' and 'OverlappingMarkerSpiderfier'