Taking the idea of a "temporary file" somewhat broadly, you could
store all of the info about each point in a Javascript object or
document element of some kind.
1. An array
As each marker is created, your script could push the marker plus the
associated data into an array. Many of the examples that folks on this
list have emulated, such as those in Mike Williams' tutorial, store
their markers in an array, and there's no reason you can't store more
than just the marker itself, i.e., lat and long, a name for the point,
a type designation (waypoint, intersection, bus stop,
destination, ...), and so on.
Pseudocode:
var places = []; //global var
// get point from a map click, then:
var newMarker = createMarker(point.LatLng,{options]);
var newPlace = {
'marker' : newMarker,
'place_id' : '1001',
'place_name' : 'Town Square',
'place_lat' : point.lat(),
'place_lon' : point.lng(),
'route_name' : 'The High Road',
'submitter' : 'Martha User'
};
map.addOverlay(newPlace.marker);
places.push(newPlace);
2. A document element
Here's another approach: Javascript gives you direct access to the
DOM, so your script could store the accumulating points by appending
them to a document object -- perhaps hidden -- such as a div or list,
an input element, or even a DocumentFragment (which is never actually
displayed, so doesn't need to be hidden). This way, the new points are
part of the virtual document created by the web browser -- no need to
create a separate file of any kind.
With either of these approaches, your users could add points as fast
as they can click the map, then go back and add info for each point
via a form in an infowindow shown by clicking that point's marker, and
finally clicking one "Save" button to send the whole batch of points
data to the server via XHR or a conventional CGI post.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---