Skip to content

Conversation

@gferioli0418
Copy link
Contributor

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.

@Podolyan98
Copy link

@gferioli0418 Hello. Can you please tell me how to use the map click listener?

@gferioli0418
Copy link
Contributor Author

gferioli0418 commented Jun 9, 2021

@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.

@Podolyan98
Copy link

@gferioli0418 Thank you! Can I move a marker on the map using coordinates from report_clickpos?

@gferioli0418
Copy link
Contributor Author

@Podolyan98 yes you can. There is an example of it in the example folder.

@Riverfount Riverfount merged commit 9677f7f into flask-extensions:master Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants