I am currently working on a project using Google App maker and I have came across the google map API Draggable Marker question posted here.
I was wondering how to save the coordinates of the marker when I drag it along the map.
I have tried the code below but it saves the coordinates of the center of the map not the marker. i've put a sample picture of what im planning to do.
var marker = widget.getAddressMarkerJs();
marker.setDraggable(true);
record.latitude = widget.latitude();
record.longtitude = widget.longitude();
UPDATE** This is my code now (an abomination >__<)
var marker = widget.getAddressMarkerJs();
marker.setDraggable(true);
marker.addListener('dragend', function (event) {
var latLng = event.latLng;
var ds = app.datasources.Nomination;
ds.item.latitude = latLng.lat();
ds.item.longtitude = latLng.lng();
});