Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

832
Views
How can I resolve? InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama

I am using the clusters markers example from the Google Maps API. https://developers.google.com/maps/documentation/javascript/marker-clustering#maps_marker_clustering-javascript

Markerclusterer CDN is already called.

But I get the error of InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama

Below is the code which I used. What am I doing wrong?

var map;

function initialize() {
  var mapProp = {
    center: new google.maps.LatLng(38, -78),
    zoom: 6,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map'), mapProp);
};

jQuery(document).ready(function() {
  var url = 'https://opendata.howardcountymd.gov/resource/96q9-qbh7.json';
  initialize();
  jQuery.getJSON(url, function(data) {
    jQuery.each(data, function(i, field) {
     
      createMarker(data);
    
      function createMarker(data) {
       const labels = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

        var markers = new google.maps.Marker({
          position: new google.maps.LatLng(data[i].location.latitude, data[i].location.longitude),
          map: map,
          label: labels[i % labels.length],
          title: field.crossroad
        });
      };
      
       // Add a marker clusterer to manage the markers.
        new MarkerClusterer({ markers, map });
    });
  });

});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!