Page 1 of 2

overlay layers

Posted: Tue Jul 01, 2014 9:41 am
by laura6372139

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.


overlay layers

Posted: Tue Jul 01, 2014 10:55 am
by Evgene Karachevtsev

Hello Laura,

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


overlay layers

Posted: Tue Jul 01, 2014 2:02 pm
by laura6372139

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


overlay layers

Posted: Tue Jul 01, 2014 2:04 pm
by laura6372139

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


overlay layers

Posted: Tue Jul 01, 2014 2:05 pm
by laura6372139

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


overlay layers

Posted: Tue Jul 01, 2014 2:06 pm
by Evgene Karachevtsev

Laura,

You should do this way:

Image


overlay layers

Posted: Tue Jul 01, 2014 2:18 pm
by laura6372139

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


overlay layers

Posted: Wed Jul 02, 2014 9:33 am
by Evgene Karachevtsev

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?


overlay layers

Posted: Wed Jul 02, 2014 3:39 pm
by laura6372139

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.


overlay layers

Posted: Thu Jul 03, 2014 8:37 am
by laura6372139

Any news?