Of course:
*Create BaseIcon as Global variable
* var baseIcon = new GIcon();
baseIcon.shadow = "/sam/images/visor/shadow50.png";
baseIcon.shadowSize = new GSize(50, 35);
baseIcon.infoShadowAnchor = new GPoint(0, 0);
baseIcon.infoWindowAnchor = new GPoint(0, 0);
baseIcon.image = "/sam/images/visor/icon_transp.png";
baseIcon.icon = "/sam/images/visor/icon_transp.png";
baseIcon.iconSize = new GSize(28, 28);
baseIcon.iconAnchor = new GPoint(0, 0);
*Creating Marker*
function creaPuntoInteres(point, icono, name) {
var iconB = new GIcon(baseIcon);
iconB.image = "/sam/images/visor/oxxo_t.gif";
markerOptions = { icon:iconB, title:name };
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
var opts = {pixelOffset:new GSize(5,5), maxWidth:280 };
marker.openInfoWindowHtml( point.name, opts);
});
*Drawing route*
function showRoute(strRuta){ //strRuta contains a String with all
points, using an XML format
var xml = null;
xml = GXml.parse(strRuta);
var routeMap = null;
routeMap =
xml.documentElement.getElementsByTagName("trucksinfo");
mapRuta = [];
if (routeMap.length == 0){
//alert("No se localizaron puntos a dibujar.");
} else {
for (var i = 0; i < routeMap.length; i++) {
var strLat =
routeMap[i].getElementsByTagName("LATITUD")[0].firstChild.nodeValue;
var strLong =
routeMap[i].getElementsByTagName("LONGITUD")[0].firstChild.nodeValue
var point = new GLatLng(parseFloat(strLat),
parseFloat(strLong));
pts1.push(point);
}
var poly1 = new GPolyline(pts1,"#ff0000",5,1);
map.addOverlay(poly1);
}
}
Sorry, but I can't show you the entire code because are restriced, but these
are the functions to draw route and create markers.
This is the first version for our map.
If more information needed, ask it to me.
Regards,
Carlos Montelongo
2008/10/4 William <[EMAIL PROTECTED]>
>
> Hi Carlos, can you post the javascript which puts the markers and
> routes on your map?
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---