Closed gferioli0418 closed 3 years ago
@gferioli0418 Hello. Can you please tell me how to use the map click listener?
@podolyan98 Hi, It is very similar to the report_clickpos feature. First, make report_markerClickPos = True then select the URL in markerClickPos_uri. Then the code should make a post request to the URI you specified whenever a marker is clicked. Also the {{gmap.varname}}_clickedMarker is a variable that you can use that tells you which marker you just clicked.
@gferioli0418 Thank you! Can I move a marker on the map using coordinates from report_clickpos?
@Podolyan98 yes you can. There is an example of it in the example folder.
I changed init.py and gmapjs.html in order to add functionality for a click listener to the marker. I fixed up the code as well to include the missing comma in file gmapjs.html in line 35 causing users to not see the map loaded up. I also added a property called {{gmap.varname}}_clickedMarker to the map in order to see the lat and lng of the last clicked marker.