Develop a stand alone simple web application using Google Maps API that allows user to draw polygons on a map and export to PHP page.
## Deliverables
**Description:**
The application should work on top of Google Maps. It must allow the user to enter polygons. These must be ‘closed’ polygons, meaning that they will define closed perimeters. The polygon might be composed by up to 20 lines. The area enclosed by the polygon will later be used by tracking software as an electronic fence. User will enter only one polygon each time.
There will be two possible types of polygons:
* **In.** Represents areas that the car cannot leave. Must be represented with the Green color;
<!-- -->
* **Out.** Represents areas that the car cannot enter. Must be represented with the Red color;
The components of the user interface are:
* The map;
<!-- -->
* An edit box where the user may type an address. This will typically be used by the user to center the map on the region he wants to work on. For instance, he will type in the name of the city or country he wants to see on the map. After he enters this address, the application must center the map on that region;
<!-- -->
* The Google's zoom tool, so the user is able to adjust the zoom at will;
<!-- -->
* A button to adjust the zoom so that the entire polygon fits the map;
<!-- -->
* User will click on the map to set the points that compose the polygon;
<!-- -->
* An edit box where the user may enter a name for the polygon;
<!-- -->
* A radio box where the user may choose the type of area (in or out);
<!-- -->
* A button to submit the data to a PHP page;
- Ideally all these components should be shown simultaneously so that the user can edit any information at any time;
Use cases are very simple:
* User enters the page to create a new polygon. He sets the polygon by clicking on specific coordinates on the map, selects if it’s an **in** or **out** polygon, gives it a name and submits it.
<!-- -->
* Users enters the page to edit an existing polygon. He is able to:
a. Move the existing points;
b. Delete existing points;
c. Add new points;
d. Edit the name of the polygon;
e. Change the type of polygon;
The developer is free to suggest how to implement these features in a way it’s practical for the user.
**Additional requirements:**
- User must be able to move or delete points at any time while he is editing the polygon;
- If the user moves the map, zooms in or out while editing the polygon, the coordinates of the points must be saved and the polygon must be shown properly again;
- When user clicks the ‘submit’ button, all data must be sent to the PHP page in a way that it can restore the entire configuration;
- User cannot submit the data without entering a name of the polygon on the edit field;
**User interface design:**
- I want to be able to review and make suggestions to the user interface design, so it’s strongly suggested that the developer submits his design ideas (Photoshop or wireframe), before actually developing the page.
**Server side requirements:**
- The server side application that will handle the data obtained from the polygons is not on the scope of this project. However, user must provide a sample PHP file that shows how to get and parse information from the map page, and how to push data back to the map page, for the ‘edit polygon’ use case.