Re: Save the markers on a map back to an xml file
I am not sure wilsonvisuals is talking about collecting the information
for storage, are you?
I initially wanted to do this thing, Timothy, but adding data straight
to an xml file is problematic, so I found.
You have to construct an input form, and I think you mean something
like this, when you click, it opens a window with an input form?
http://www.panoramio.com/#lt=28&ln=-33&z=15&k=2&user=0
Also, there are some good examples of forms in windows for direction
finding.
Then, you submit that form to a php (or asp etc.) script to insert the
data into your xml file.
Okay, I am new, didn't know php 2 month's ago, but soon found out that
it is very tough to write straight to an xml file using php. I found
this script - http://www.phpclasses.org/browse/package/2033.html -
which is THE ONLY ONE I could find that worked on all the servers I
tried, because xml support for php is not consistent.
Anyways, I tried to adapt this form to put lat and lng into a xml, and
it worked.
However, it is way easier (as far as I can tell) using a mysql
database, and then converting the requests into xml for the map
display. This sounds to me like you would have the ability to get
different combinations of marker data quite easily for disply. You can
still use http request
"// Read the data from example.xml
var request = GXmlHttp.create();
request.open("GET", "example.xml", true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = request.responseXML;
// obtain the array of markers and loop through it
var markers =
xmlDoc.documentElement.getElementsByTagName("marker");"
and I am not there yet, but perhaps you can just substitute, in this
statement - GET", "example.xml", true - querypage.php like so:
GET", "querypage.php", true
and this leads to -> querypage.php?markersid=some_area.
Then, you display your points and markers according to wilsonvisuals
code above. (I sincerely hope I am not mistaken, please correct me if I
am wrong)
My eyes lit up when I saw this topic, I sure am interested in ways to
write to an xml file with php! My host, at least, hasn't got domxml
configured, and I am trying out some PEAR functions as an alternative.
Tree.php in the PEAR library (installed with php and configured by
default, usually!) is good for parsing xml, I just have to learn how to
append and save!
0 Comments:
Yorum Gönder
<< Home