I am currently working on a demo to showcase the functionality of a future search feature. My goal is to query Google for information based on an address or area and then display the area bounds along with nearby places. To achieve this, I am utilizing tools like places autocomplete, geocode, and places search.
Up to this point, I have managed to receive predicted search queries which are then used to draw a rectangle representing the bounds on my map. However, I have encountered an issue when trying to add markers for the place search results as they do not appear on the map. Despite confirming that the search is functioning correctly by displaying lat/lng values in the createMarker function, I suspect that the map object may not be properly passed to the createMarker function.
Although I attempted to pass an additional parameter, it did not yield the desired outcome. It's worth mentioning that I can successfully create a marker within the initialize function when attempting to generate a single static marker.
UPDATE: I experimented with removing the type parameter from the place search request, but even adding the parameter ['store'] did not resolve the issue.
var map;
var infowindow;
function initialize() {
// JavaScript code goes here...
}