You are not logged in.
Pages: 1
Hello, I refer to the example:
$('#test').gmap3(
{ action: 'addKmlLayer',
url: 'http://www.gmap3.net/kml/rungis.kml',
options:{
suppressInfoWindows: true
},
tag:'chk1'
},
{ action: 'addKmlLayer',
url: 'http://www.gmap3.net/kml/sogaris.kml',
options:{
suppressInfoWindows: true
},
tag:'chk2'
}
);
$('.tools input[type=checkbox]').change(function(){
var map = $('#test').gmap3('get'),
kml = $('#test').gmap3({
action:'get',
name:'kmllayer',
tag: $(this).attr('id')
});
kml.setMap( $(this).is(':checked') ? map : null );
});if I have a lot of kml tags that have a part of the same,
I can hide
with a unique ceckbox?
I would like to group files into "levels", each ceckbox show / hide ALL the kml that level...
action:'get',
name:'kmllayer',
tag: jQuery(this).attr('id')+ String$('#test').gmap3(
{ action: 'addKmlLayer',
url: 'http://www.gmap3.net/kml/rungis.kml',
options:{
suppressInfoWindows: true
},
tag:'chk1_a'
},
{ action: 'addKmlLayer',
url: 'http://www.gmap3.net/kml/sogaris.kml',
options:{
suppressInfoWindows: true
},
tag:'chk1_b'
}
{ action: 'addKmlLayer',
url: 'http://www.gmap3.net/kml/xxxx.kml',
options:{
suppressInfoWindows: true
},
tag:'chk2'
}
);
$('.tools input[type=checkbox]').change(function(){
var map = $('#test').gmap3('get'),
kml = $('#test').gmap3({
action:'get',
name:'kmllayer',
tag: $(this).attr('id') <-- ?????
});
kml.setMap( $(this).is(':checked') ? map : null );
});
Offline
declare your id outside of the gmap3 object where your "this" will refer to the input
$('.tools input[type=checkbox]').change(function(){
var id=this.id
var map = $('#test').gmap3('get'),
kml = $('#test').gmap3({
action:'get',
name:'kmllayer',
tag: id
});
kml.setMap( $(this).is(':checked') ? map : null );
});
Offline
Pages: 1