Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 21st, 2008, 07:22 AM
Registered User
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update Google Map API Markers

i'm trying to figure out how to update a map marker for the Google Maps API. i took existing code that works correctly and tried to apply it to my solution but i haven't been able to get it to work... here is the code that works to store new markers (slightly abbreviated)...

function storeMarker() {
    var getVars = "?species=" + document.getElementById("species").value        
        + "&lat=" + lat;

    var request = GXmlHttp.create();

    //open the request to storeMarker.php on your server
    request.open('GET', 'storeMarker.php' + getVars, true);
    request.onreadystatechange = function() {
        if (request.readyState == 4) {
    return false;
for my solution, i have the following function that is triggered by this code...

<form name="MarkerForm" onSubmit="return updateMarker()">

all of the fields are inside the form and i have confirmed the URL string is formatted correctly with the alert(); below. the updateMarker.php page has been tested independently and works correctly, but when i try to update a marker from the map API it does not update the form data or database record and does not give me any errors. any suggestions? thanks!

function updateMarker() {
        var getData = "?species=" + document.getElementById("species").value
                 + "&lat=" + lat;

    //alert('updateMarker.php' + getData); <-- this has confirmed the URL string is formatted correctly

    var request = GXmlHttp.create();
    request.open('GET', 'updateMarker.php' + getData, true);

    return false;

Similar Threads
Thread Thread Starter Forum Replies Last Post
google map clicked coordinates neon20 Javascript 4 June 18th, 2008 07:32 AM
Heat Map over Google Map ajit Javascript 0 March 7th, 2008 09:01 AM
google map GetDirections problem mrjoka Javascript How-To 0 October 4th, 2007 09:08 AM
Change Series Color in Stacked Line Markers chart Jell Pro VB.NET 2002/2003 0 July 13th, 2005 06:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.