Puf, no veo nada, asi separado me salen dos mapas,
con el mismo nombre de la funcion createmarker me sale solo marcadores en mapa 1,
si cambio el nombre de la funcion createmarker al nombre createmarker2 me sale solo marcadores en mapa 2....
A ver si alguien ve algo mas que se debe de cambiar:
Código Javascript
:
Ver original<script type="text/javascript">
window.onload=function(){
initialize();
initialize2();
}
</script>
<script type="text/javascript">
//<![CDATA[
var map = null;
function initialize() {
var myOptions = {
zoom: 13,
center: new google.maps.LatLng(36.51308543049258, -4.886341094970703),
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
// Add markers to the map
// Set up three markers with info windows
var point = new google.maps.LatLng(36.50856685143835, -4.866085052490234);
var marker = createMarker(point,'<div style="width:240px">Banana Beach, several 2 and 3 bedrooms, beach front apartments in a beautiful complex, sleeps 4-6 persons <a href="banana_beach_beachfront_apartment_marbella.htm">Link<\/a><\/div>')
}
var infowindow = new google.maps.InfoWindow(
{
size: new google.maps.Size(150,50)
});
function createMarker(latlng, html) {
var contentString = html;
var marker = new google.maps.Marker({
position: latlng,
map: map,
zIndex: Math.round(latlng.lat()*-100000)<<5
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
}
</script>
<script type="text/javascript">
//<![CDATA[
var map2 = null;
function initialize2() {
var myOptions2 = {
zoom: 13,
center: new google.maps.LatLng(36.488661268293136, -4.986934661865234),
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map2 = new google.maps.Map(document.getElementById("map_canvas2"),
myOptions2);
google.maps.event.addListener(map2, 'click', function() {
infowindow.close();
});
// Add markers to the map
// Set up markers with info windows
var point = new google.maps.LatLng(36.502530170146976, -4.951658248901367);
var marker2 = createMarker(point,'<div style="width:240px">Dama de Noche, apartments 2, 3 and 4 bedrooms, near Puerto Banus and beach, sleeps 4-8 <a href="dama_de_noche_puerto_banus.htm">Link<\/a><\/div>')
}
var infowindow = new google.maps.InfoWindow(
{
size: new google.maps.Size(150,50)
});
function createMarker2(latlng, html) {
var contentString = html;
var marker2 = new google.maps.Marker({
position: latlng,
map: map2,
zIndex: Math.round(latlng.lat()*-100000)<<5
});
google.maps.event.addListener(marker2, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map2,marker2);
});
}
</script>