on-internet
← Community

Cannot read setMap property of undefined while using Google maps Javascript API

Stack Overflow ·

I call the initialize function on page load. Which correctly setsup all the markers. Then I have a searchbox along with a submit button which clears all the markers and then fetches a new JSON object which consist of new markers to be created. As soon as I enter a search query and call the getWorldTweets function I get this error: Cannot read setMap property of undefined which points to the addMarker and deleteMarker functions. var map; var marker; var allmarkers = []; var iterator = 0; var riterator = 0; var geocoder = new google.maps.Geocoder(); var search = { q: "" }; function initialize()

Comments

Sign in or sign up to comment and upvote.

No comments yet.