Hi Andrew,
o.k. - but sorry..... i don't know how I can do that.....
This is the Code
+++++++++++++++++++++++++++++++
<script type="text/javascript">
var map;
var gdir;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
gdir = new GDirections(map, document.getElementById
("directions"));
GEvent.addListener(gdir, "error", handleErrors);
GEvent.addListener(gdir, "addoverlay",
onGDirectionsAddOverlay); // Triggers marker swap, Esa
map.setCenter(new GLatLng(0,0),0); // inital setCenter() added by
Esa.
setDirections("Güterstrasse 10, 4133 Pratteln", "Kraftwerkstrasse
7, 4133 Pratteln", "de_CH");
// api version display added by Esa
document.getElementById("api-v").innerHTML = '2.'+G_API_VERSION;
}
}
function setDirections(fromAddress, toAddress, locale) {
gdir.load("from: " + fromAddress + " to: " + toAddress,
{ "locale": locale , "getSteps":true});
}
function handleErrors(){
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("Es konnte keine entsprechende geografische Position oder
Adresse gefunden werden. Dies kann daran liegen, dass die Adresse
verhältnismässig neu oder falsch ist.\nError code: " + gdir.getStatus
().code);
else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
alert("Diese Anfrage konnte nicht erfolgreich bearbeitet werden.
Der Grund für den Ausfall ist momentan nicht bekannt.\n Error code: "
+ gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
alert("Der Parameter HTTP q verfehlte oder hatte keinen Wert. Für
geocoder Anfragen bedeutet dies, dass eine leere Adresse als Eingang
spezifiziert wurde. Für Richtungsanfragen bedeutet dieses, dass keine
Frage im Eingang spezifiziert wurde.\n Error code: " + gdir.getStatus
().code);
else if (gdir.getStatus().code == G_GEO_BAD_KEY)
alert("Der gegebene Schlüssel ist entweder unzulässig oder stimmt
nicht mit der Domain überein, für die er generiert wurde. \n Error
code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
alert("Ein Richtungsantrag konnte nicht erfolgreich analysiert
werden.\n Error code: " + gdir.getStatus().code);
else alert("An unknown error occurred.");
}
///////////////////////////////////////////////////////////////////////
/**
* The add-on code for draggable markers
* @author Esa 2008
*/
var newMarkers = [];
var latLngs = [];
var icons = [];
// Note the 'addoverlay' GEvent listener inside initialize() function
of the original code (above).
// 'load' event cannot be used
function onGDirectionsAddOverlay(){
// Remove the draggable markers from previous function call.
for (var i=0; i<newMarkers.length; i++){
map.removeOverlay(newMarkers[i]);
}
// Loop through the markers and create draggable copies
for (var i=0; i<=gdir.getNumRoutes(); i++){
var originalMarker = gdir.getMarker(i);
latLngs[i] = originalMarker.getLatLng();
icons[i] = originalMarker.getIcon();
newMarkers[i] = new GMarker(latLngs[i],{icon:icons[i],
draggable:true, title:'Verschiebbar'});
map.addOverlay(newMarkers[i]);
// Get the new waypoints from the newMarkers array and call
loadFromWaypoints by dragend
GEvent.addListener(newMarkers[i], "verschoben", function(){
var points = [];
for (var i=0; i<newMarkers.length; i++){
points[i]= newMarkers[i].getLatLng();
}
gdir.loadFromWaypoints(points);
});
//Bind 'click' event to original markers 'click' event
copyClick(newMarkers[i],originalMarker);
// Now we can remove the original marker safely
map.removeOverlay(originalMarker);
}
function copyClick(newMarker,oldMarker){
GEvent.addListener(newMarker, 'click', function(){
GEvent.trigger(oldMarker,'click');
});
}
}
</script>
+++++++++++++++++++++++++++++++
Please can you show me, where i should place that!?
Thanks alot
Andy
On 20 Mrz., 13:16, Andrew Leach <[email protected]> wrote:
> On Mar 20, 9:38 am, thagency <[email protected]> wrote:
>
> > Hi Larry,
>
> > No, i don't think, that i mean what you think. I don't want to change
> > the backgound color of the whole directions (text) result - just the
> > background color from the top bar and bottom bar.
>
> That's what Larry found for you. It's in the function waypoint (under
> the
> // === waypoint banner ===
> comment, and sets the background colour of the waypoint bars.
>
> Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---