Ren Ren - 6 months ago 113
PHP Question

How to create a geo fence and save the area from google map using php

How to create a geo fence and save the area from google map
in php.

User would be able to draw the geo fence on the google map the shape could be circle or rectangle and that area needs to be saved, which needs to be used to display ads when the user is in the defined geo fence.

Pls let me know how this can be done in php using google maps.

Answer

In general terms, one way you can do it is use the Drawing Tools library to allow the user to create a Polygon: http://code.google.com/apis/maps/documentation/javascript/overlays.html#drawing_tools

Set an event listener for the polygoncomplete event. When that fires, user getPaths() or getPath() to pull out the path and send it to your server.

Comments