N
N
Nikita Gulyaev2014-01-16 13:50:10
JavaScript
Nikita Gulyaev, 2014-01-16 13:50:10

How to get data in Google Maps API when clicking on a marker and put it in another element outside the map?

I have an array with marker coordinates. What needs to be done is to get either the name that I will pass to the marker object (if possible) or addresses when clicking on the marker. It is necessary to make a choice of a place and then filter the data from the database (name, address and coordinates in the database). Is it possible to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Push Pull, 2014-01-17
@deadbyelpy

Simply, when creating markers, hang an event handler on it

var marker = new Marker(some_data);
google.maps.event.addListener(marker, 'click', function() {
    ваша_функция();
  });

Google Map v3 Events

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question