Open chrisvwn opened 5 years ago
Also, is it possible to access the result from the search rather than just the coordinates? Possibly the location and address data of the result?
You should be able to observe input$map_place_search
Which returns
eventInfo = {
address_components: place.address_components,
lat: place.geometry.location.lat(),
lon: place.geometry.location.lng(),
name: place.name,
address: place.formatted_address,
place_id: place.place_id,
vicinity: place.vicinity,
randomValue: Math.random()
};
Clicking on other place markers not searched for do trigger the observer.
By 'other place markers', do you mean the icons you see already loaded on the map? If so, these are considered part of the 'map', and not markers, which is why they would trigger the input$mapId_map_click
event.
The markers placed after a search are custom, temporary markers and are not considered part of the map.
Yes, I meant the icons already loaded on the map. Noted that these are part of the map while the search result markers are temporary.
However, seems like this actually blocks out that part of the map now so that even underlying parts of the map and icons cannot be clicked. I wonder if it would be possible to either make this custom marker clickable possibly returning the same data as the search? Or maybe allow clicking through to the map?
When using the search_box in google_map clicking on the result "marker" does not trigger the input$mapId_map_click observe event.
Clicking on other place markers not searched for do trigger the observer.
Also, is it possible to access the result from the search rather than just the coordinates? Possibly the location and address data of the result?