[OpenLayers-Users] From Combo to Map
Luciano - Uol
l.s.borges at uol.com.br
Thu Oct 2 09:16:41 EDT 2008
Hi All,
When I draw a polygon in a map, i put this id in a combobox, i would
like to know how can i choose an item from combobox and automaticaly
make the polygon selected?
I know how to select the polygon clicking there.
See my code:
// after create a polygon, put this id a combobox
function onFeatureAdded(feature){
idVetor = feature.id.split("_")[1];
tpVetor = feature.geometry.toString().split("(")[0];
with (document.f1.poligonos) {
options[options.length] = new Option (tpVetor + " " + idVetor,
feature.id);
}
}
function selecionaPoligono(vetor){
alert(vetor);
// the code i want comes here.
}
//HTML Code - here i'll put the vector
<select name="poligonos" onchange="selecionaPoligono(this.value)">
<option value="null">Selecione um polígono</option>
</select>
Thanks, Luciano.
More information about the Users
mailing list