0
votes

I'm developing a Google map based app in Cordova, and would like to trigger an info window pop up based on matching results of the place name in a search bar at the top (I have all of the location names, latitudes, longitudes, custom markers, and info window content stored in a Web SQL database). Just wondering the best way to do this that won't duplicate info window pop ups that are triggered by clicking the marker.

There are also multiple locations with the same name (different branches with the same company name) and I'm wanting to zoom out the map and show all matching info window pop ups at the same time if the company name is searched in the search bar. Does anyone know if this is possible?

1

1 Answers

0
votes

Not quite understand your question,

you can make infowindow open anytime you want

Infowindow open after search:

//put in your callback of matching results of the place name in a search bar
var infowindow = new google.maps.InfoWindow();
infowindow.setContent(yourContent)
infowindows.push(map,mark)

for second question

you can see google api document,use google LatlngBounds,

//set google map bounds obj
var bounds = new google.maps.LatLngBounds()

//for every place you want to display on map
if (place.geometry.viewport)
    bounds.union(place.geometry.viewport)
else
    bounds.extend(place.geometry.location)
//finally
map.fitBounds(bounds)