Ciao a tutti!
vorrei integrare del codice ASP in un javascript...più precisamente...
ho scaricato lo script che google maps disponde per poter inserire i punti di interesse....
solo che le coordinate dei vari punti io li prendo da database e vorrei creare un ciclo che stampa le stringhe di JS con relative coordinate dei vari punti che devono apparirmi nella mappa...
il codice js è così(esempio):
<script type="text/javascript">
// This function picks up the click and opens the corresponding info window
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
// create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(45.9862, 9.2596),13);
// add the points
var point = new GLatLng(45.9439, 9.1268);
var marker = createMarker(point,"Argegno","Argegno")
map.addOverlay(marker);
var point = new GLatLng(45.9862, 9.2596);
var marker = createMarker(point,"Bellagio","Bellagio")
map.addOverlay(marker);
// put the assembled side_bar_html contents into the side_bar div
document.getElementById("side_bar").innerHTML = side_bar_html;
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
//]]>
</script>
in questo modo mi inserisce 2 punti di interesse...
io volevo integrare questo codice ASP(esempio):
<%
StrCor=("45.9439, 9.1268;45.9862, 9.2596;45.9104,9.1321;45.9907,9.2374")
StrCit=("citta1;citta2;citta3")
ArrCor=split(StrCor,";")
ArrCit=split(StrCit,";")
for i=0 to ubound(ArrCor)
%>
var point = new GLatLng(<%ArrCor(i)%>);
var marker = createMarker(point,"<%ArrCit(i)%>","<%ArrCit(i)%>" )
map.addOverlay(marker);
<%next%>
ho provato cosi' ma non funziona....visto che io e il javascript siamo agli antipodi volevo sapere come potere fare una integrazione corretta per fare funzionare questo script.
Grazie!

Rispondi quotando