Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add markers to google maps based on form info

I was wondering if anyone knew of a tutorial or how to use a form to add markers to a google map. I want a person to be able to select some things from a form and click submit and have it refresh the map with the markers on it. I assume the map will have to be in an iframe or something, but I am not sure how to do the markers like that. Anything will help

like image 322
shinjuo Avatar asked Nov 14 '22 03:11

shinjuo


1 Answers

First of all you don't need a refresh to add markers on the map.With javascript api you can add markers on the fly to the map.Now if you also want these locations to be stored in a database than you should probably make a form,although an ajax request will be just fine.So as orbling mentioned start by reading the documentation.

Nevertheless i will give a simple scenario and actions to solve it.

  1. Make a database in lets say mysql to store your points.
  2. Create a page with a map
  3. Create some textfields and some button on that same page to trigger some actions like adding markers
  4. On some events send ajax requests to the server to store your location.

These actions can be implemented let's say with php+mysql or jsp+postgis or any combination you like.

like image 150
Argiropoulos Stavros Avatar answered Jan 05 '23 03:01

Argiropoulos Stavros