April 13, 2008
I have a web-site that is a Google Map mash-up and I place my markers by listing them in the body right after the map loads (in a load function).
I convert my data from a spreadsheet to xml and then use a program to write the xml into a list that displays the information the way I want it. I do not insert the xml tags because I don’t want them in my html because I do not know how they would react, and I really don’t know where they would go once I pull the info out of the xml doc anyway. I insert the xml in with other text.
Right now I am cutting and pasting the data into my html but eventually I want to automate this. But I do not know how to “grab” the data since there are no tags or id’s. I think that it is in the tree somewhere but can anyone give me an idea where and how to identify this?
Typical lay-out in the html below. The code below “// add markers” is the code in which I am interested.
I hope this makes sense.
Thanks,
loboman
// ..... </head>
<body onload="load()" >
// divs here
<script type="text/javascript">
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(12.942,100.8888), 13);
map.setMapType(G_NORMAL_MAP);
map.addControl(new GLargeMapControl());
// add markers
var point = new GLatLng( 12.94675,100.88696);
var marker = createMarker(point,'Soi 1 Pattaya','soi','66');
map.addOverlay(marker);
var point = new GLatLng( 12.93307,100.88154);
var marker = createMarker(point,'Soi 10 Pattaya','soi','67');
map.addOverlay(marker);
var point = new GLatLng( 12.9317,100.88198);
var marker = createMarker(point,'Soi 11 Pattaya','soi','68');
map.addOverlay(marker);
//... etc.