Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Blaenzo
Advocate I
Advocate I

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
Blaenzo
Advocate I
Advocate I

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'

 

 

 

View solution in original post

1 REPLY 1
Blaenzo
Advocate I
Advocate I

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'

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.