erdem / django-map-widgets

Highly customizable, intuitive, and user-friendly map widgets for GeoDjango applications.
MIT License
450 stars 119 forks source link

Undefined geocoding response object "place" when triggering "google_point_map_widget:marker_change" #125

Closed A4TIF closed 2 years ago

A4TIF commented 3 years ago

I don't seem to get the "place" object in the console logs when marker_change is triggered. Others logs are fine. Can't seem to figure out why that is. I was hoping to capture more details from the response and display them as well. Any help will be appreciated. Thanks.

$(document).on("google_point_map_widget:marker_change", function (e, place, lat, lng, locationInputElem, mapWrapID) {
    console.log(place); // Google geocoding response object
    console.log(locationInputElem); // django widget textarea widget (hidden)
    console.log(lat, lng);  // changed marker coordinates
    console.log(mapWrapID); // map widget wrapper element ID
});

Env: django-map-widgets 0.3.2 django 2.2.24 Python 3.7

adonig commented 2 years ago

Is there a workaround besides doing a reverse geocode request?

A4TIF commented 2 years ago

it works with google_point_map_widget:place_changed event, so hopefully that should help. "marker_change" doesn't have the place object.

erdem commented 2 years ago

I am late to cover this one but I have fixed the place object bind issues in the new release. (0.4.0)

https://pypi.org/project/django-map-widgets/0.4.0/