Hello there!
I have a map with a javascritp.
But now I want to superimpose on this base map when I click the checkbox other markerts
I try whit this code:
var map = Appery('googlemap_5').gmap;
var contentString1= ""+
""+
""+
""+
""+
""+
"";
var infowindow1 = new google.maps.InfoWindow({
content: contentString1
});
var sfLatlng1 = new google.maps.LatLng(38.820907,-0.610595);
var marker1 = new google.maps.Marker({
position: sfLatlng1,
map: map,
title:"Plaça Major i Ajuntament",
icon: "http://maps.google.com/mapfiles/kml/s..."
});
google.maps.event.addListener(marker1, 'click', function() {
infowindow1.open(map,marker1);
});
And the market doesn't appear:
And if I put this code the initial markets disappear:
var myOptions = {
zoom :17,
center: new google.maps.LatLng(38.8214,-0.609431),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map($('div[dsid="googlemap_5"]').get(0), myOptions);
var contentString1= ""+
""+
""+
""+
""+
""+
"";
var infowindow1 = new google.maps.InfoWindow({
content: contentString1
});
var sfLatlng1 = new google.maps.LatLng(38.820907,-0.610595);
var marker1 = new google.maps.Marker({
position: sfLatlng1,
map: map,
title:"Plaça Major i Ajuntament",
icon: "http://maps.google.com/mapfiles/kml/s..."
});
google.maps.event.addListener(marker1, 'click', function() {
infowindow1.open(map,marker1);
});
With this code; first, appear this:
When I click the checkbox appear this:
Can i help me?
I need that when I click the checkbox, markets are added on the map.
And the other markets of the initial map doesn't disappear.
Thanks
Laura.