steps:
a javascript solution for that particular challenge looks the following way:
var testString = "http://www.google.at/img/s200/";
var partToBeReplaced = /s200/;
var newPart = "s1600";
var replacedTestString = testString.replace(partToBeReplaced, newPart);
The steps do do so would be the following:
In order to get a kick start, here the helloWorld.xml
<?xml version="1.0" encoding="UTF-8" ?>
Description of the structure:
For JavaScript debugging one can use the Firefox add-on Firebug.
To install the add-on: go to the 'Firefox' button in the browser, select 'add-ons', then search for 'Firebug' using the search engine and consequently install the add-on.
After restarting Firefox go to the 'Firefox' button again, select 'Web Developer', 'Firebug', 'Open Firebug'. Then the Firebug panel will open in the lower side of the opened tab. There select 'Script' and 'Enable' and you are ready to start debugging.
To debug you can insert breakpoints and then reload the page. It will break when encountering the line. Then you have the possibility to see variable values, continue running the script, enter, skip or exit functions etc.
Drawing the lines is easy with the use of the well documented Google Maps JavaScript API.
http://code.google.com/apis/maps/documentation/javascript/overlays.html
For lines i used Polylines "A Polyline object consists of an array of LatLng locations, and creates a series of line segments that connect those locations in an ordered sequence."
So first prepare the coordinates
coordinateArray[pointNr] = new GLatLng(Latitude, Longitude);
and then draw the polyLine on the map
var polyLine = new GPolyline(coordinateArray, color, opacity, weight);
_map.AddOverlay(polyLine)
For creating the stations i used GMarker with a customized GIcon.
The click event for showing additional information is done by adding an GEvent
Simple example:
var marker = new GMarker(point, icon); //point = single GLatLng object
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(text);
});
_map.addOverlay(marker);
the text can contain HTML Tags like links etc.