How to Use Spider Cluster And Html Marker Layer in React Application Using Azure Maps

Nilesh Khonde 40 Reputation points
2024-04-29T13:28:14.2366667+00:00

I'm developing an application using React And Azure Maps. Within it, I'm encountering an issue with the spider cluster and HTML marker layer. The problem arises as the spider cluster is not defined in Atlas within the Node modules. I've referenced sample code from Azure Maps, where they utilize min.js files in their application. How can I incorporate these same JavaScript files into my React application?Screenshot 2024-04-29 185102

Screenshot 2024-04-29 185119

I'm attempting to load the files this way because I've saved the folder of JavaScript files from Azure Maps and I'm trying to use them in my React application. However, the scripts aren't loading. Your suggestions would be greatly appreciated. Thanks in advance.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
601 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 15,471 Reputation points Microsoft Employee
    2024-04-29T15:22:02.55+00:00

    First off, verify you have the azure-maps-spider-clusters.min.js file in your folder (it's not shown in the screenshot).

    Make sure you have the latest version of that file by pulling it from the dist folder of the original open-source project and not from the code sample site (the code sample site may be a few versions behind the current version).

    From there, check the console and network tabs of the developer tools in the browser to see if the request is being made and is successful.