If you put the identifier in the type select box in your php, you can add some lines of code to your javascript above.
The following assumes that the types selector has an identifier of the marker type:
function addNewMarker(newAddress){ var set; var lat; var longi; var e = document.getElementById("marker-type"); var mtype = e.options[e.selectedIndex].value; if(set==null){ set=1; geocoder = new GClientGeocoder(); geocoder.getLatLng(newAddress, function(point){ if(!point){ alert(address + " not found"); }else{ lat = point.y; longi = point.x; alert("The latitude of " + newAddress + " is " + lat + " and longitude is " + longi); default_address.push([latitude,longitude]); location.href="testmap.php?lat="+lat+"&longi="+longi+"&set="+set+"&newAdd="+newAddress+"&type="+mtype; } }); } }
Note that in the AddMarker function, I added a new variable for "mtype", which selects the selection field and receives the current value of the parameter.
Then below, where the API calls testmap.php, I added a type selector and gave it a value for the variable "mtype".
Later in the testmap.php code, you simply follow using:
$_GET['type']
source share