laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

Hello there!

I have a map with a javascritp.

Image

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:

Image

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:

Image

When I click the checkbox appear this:

Image

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

overlay layers

Hello Laura,

Your code seems to be corrupted by getsatisfaction.com. Could you please repeat it using tag < code

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

When this code appears:

< code 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= "div id='content'"+
"form id='button'"+
"div"+
"input type='button' style='background-color:white;border-width:thin;border-style:solid;border-color:white' value='Tapas' onclick=location.href='agullent1c.html"+
"div"+
"form"+
"div";

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);
}); < code

Image

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

But 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

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

When I put this code and I click in the checkbox the others markets diseappear

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

overlay layers

Laura,

You should do this way:

Image

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

This code I put in checkbox click runjavascript: codevar myOptions = {
zoom :17,
center: new google&#46;maps&#46;LatLng(38&#46;8214,-0&#46;609431),
mapTypeId: google&#46;maps&#46;MapTypeId&#46;ROADMAP
};

var map = new google&#46;maps&#46;Map($('div[dsid="googlemap_5"]')&#46;get(0), myOptions);

var contentString1= "<div id='content'>"+
"<form id='button'>"+
"<div>"+
"<input type='button' style='background-color:white;border-width:thin;border-style:solid;border-color:white' value='Tapas' onclick=location&#46;href='agullent1c&#46;html'>"+
"<>"+
"</form>"+
"<>&quot

var infowindow1 = new google&#46;maps&#46;InfoWindow({
content: contentString1
});

var sfLatlng1 = new google&#46;maps&#46;LatLng(38&#46;820907,-0&#46;610595);
var marker1 = new google&#46;maps&#46;Marker({
position: sfLatlng1,
map: map,
title:"Plaça Major i Ajuntament",
icon: "http:&#47;&#47;maps&#46;google&#46;com/mapfiles/kml/shapes/dining&#46;png"
});
google&#46;maps&#46;event&#46;addListener(marker1, 'click', function() {
infowindow1&#46;open(map,marker1);
});/code

When this code when I click checkbox, the icons of the initial map doesn't disappear.

And this code:

code

var map = Appery('googlemap_5')&#46;gmap;

var contentString1= "<div id='content'>"+
"<form id='button'>"+
"<div>"+
"<input type='button' style='background-color:white;border-width:thin;border-style:solid;border-color:white' value='Tapas' onclick=location&#46;href='agullent1c&#46;html'>"+
"<>"+
"</form>"+
"<>&quot

var infowindow1 = new google&#46;maps&#46;InfoWindow({
content: contentString1
});

var sfLatlng1 = new google&#46;maps&#46;LatLng(38&#46;820907,-0&#46;610595);
var marker1 = new google&#46;maps&#46;Marker({
position: sfLatlng1,
map: map,
title:"Plaça Major i Ajuntament",
icon: "http:&#47;&#47;maps&#46;google&#46;com/mapfiles/kml/shapes/dining&#46;png"
});
google&#46;maps&#46;event&#46;addListener(marker1, 'click', function() {
infowindow1&#46;open(map,marker1);
});/code

Don't working!

I need that when I click the checkbox the new icons that appear, and that the initial map with icons also appear

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

overlay layers

Hello Laura,

Please detail, if you check checkbox then a marker should appear on the map? And if you uncheck it, then appropriate maker should disappear? Other markers (which are already on the map) should stay or disappear?

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

Initially I have a base map with icons.

Image

When I click checkbox I need new icons appear on the map base without initial icons disappear.

But with this code base map icons are replaced with the new icon.

codevar myOptions = {
zoom :17,
center: new google&#46;maps&#46;LatLng(38&#46;8214,-0&#46;609431),
mapTypeId: google&#46;maps&#46;MapTypeId&#46;ROADMAP
};

var map = new google&#46;maps&#46;Map($('div[dsid="googlemap_5"]')&#46;get(0), myOptions);

var contentString1= "<div id='content'>"+
"<form id='button'>"+
"<div>"+
"<input type='button' style='background-color:white;border-width:thin;border-style:solid;border-color:white' value='Tapas' onclick=location&#46;href='agullent1c&#46;html'>"+
"<>"+
"</form>"+
"<>&quot

var infowindow1 = new google&#46;maps&#46;InfoWindow({
content: contentString1
});

var sfLatlng1 = new google&#46;maps&#46;LatLng(38&#46;820907,-0&#46;610595);
var marker1 = new google&#46;maps&#46;Marker({
position: sfLatlng1,
map: map,
title:"Plaça Major i Ajuntament",
icon: "http:&#47;&#47;maps&#46;google&#46;com/mapfiles/kml/shapes/dining&#46;png"
});
google&#46;maps&#46;event&#46;addListener(marker1, 'click', function() {
infowindow1&#46;open(map,marker1);
}); /code

Image
I want to display all the icons together.

Base map icons more icons when I click on the checkbox

Thanks, Laura.

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

overlay layers

Any news?

Return to “Issues”