D
D
dom1n1k2017-03-26 14:42:46
Google Maps
dom1n1k, 2017-03-26 14:42:46

Why do events in Google Maps work through one place?

Google maps blew my mind.
I will not ask why the handler is put there in a million ways and what is the difference between them.

google.maps.event.addListener(map, event, handler);
google.maps.event.addDomListener(map, event, handler);
map.addListener(event, handler);

I won't ask why they did the removal of the handler in a different way than is customary everywhere.
I will only ask why the object of the event itself is not passed to the event handler?! To get the target from there and all that. Just unfine and smoke bamboo.
map.addListener('bounds_changed', function (e) {
    e.something... // undefined!
});

Moreover, there are similar examples in the documentation, for example here:
https://developers.google.com/maps/documentation/j...
StackOverflow seems to recommend binding to this, which, in theory, should be equal to the map instance, but it is not clear how from it to get, for example, the coordinates of the click?
Who has experience, where to look and how to fight?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question