1 //mapApp that handles window resizing
2 var myMapApp
= new mapApp(false,undefined);
4 //global selectionLists
8 function initMap(evt
) {
9 //first a few styling parameters:
10 var comboBoxCellHeight
= 16;
11 var comboBoxTextpadding
= 3;
12 var comboBoxtextStyles
= {"font-family":"Arial,Helvetica","font-size":11,"fill":"dimgray"};
13 var comboBoxStyles
= {"stroke":"dimgray","stroke-width":1,"fill":"white"};
14 var comboBoxScrollbarStyles
= {"stroke":"dimgray","stroke-width":1,"fill":"whitesmoke"};
15 var comboBoxSmallrectStyles
= {"stroke":"dimgray","stroke-width":1,"fill":"lightgray"};
16 var comboBoxHighlightStyles
= {"fill":"dimgray","fill-opacity":0.3};
17 var comboBoxTriangleStyles
= {"fill":"dimgray"};
18 //arrays for selectionList data
19 var fruitsGerman
= [{key
:"Orangen",value
:false},{key
:"Äpfel",value
:false},{key
:"Bananen",value
:true},{key
:"Birnen",value
:false}];
20 var flowers
= new Array({key
:"Acacia",value
:false},{key
:"Acanthus",value
:false},{key
:"Amaranth",value
:false},{key
:"Anthericum",value
:false},{key
:"Arum",value
:false},{key
:"Ash",value
:true},{key
:"Aspen",value
:false},{key
:"Aster",value
:false},{key
:"Balm",value
:false},{key
:"Barbery",value
:false},{key
:"Basil",value
:false},{key
:"Bellflower",value
:true},{key
:"Bindweed",value
:false},{key
:"Bird cherry-tree",value
:false},{key
:"Black thorn",value
:false},{key
:"Bladder-senna",value
:false},{key
:"Bluebottle",value
:false},{key
:"Borage",value
:false},{key
:"Box",value
:false});
21 var roses
= new Array({key
:"Butterscotch",value
:false},{key
:"Ci Peace",value
:false},{key
:"Impatient",value
:false},{key
:"Lady Hillingdon",value
:false},{key
:"Lavaglut",value
:false},{key
:"Mission Bells",value
:false},{key
:"Sexy Rexy",value
:false},{key
:"Souvenir de Pierre Notting",value
:false},{key
:"Sunflare",value
:false},{key
:"Whisky Mac",value
:false},{key
:"Whisper Floribunda",value
:false});
22 var communitiesAarau
= new Array({key
:"Aarau",value
:false},{key
:"Aarburg",value
:false},{key
:"Abtwil",value
:true},{key
:"Ammerswil",value
:false},{key
:"Aristau",value
:false},{key
:"Arni (AG)",value
:false},{key
:"Attelwil",value
:false},{key
:"Auenstein",value
:false},{key
:"Auw",value
:false},{key
:"Baden",value
:false},{key
:"Baldingen",value
:false},{key
:"Beinwil (Freiamt)",value
:false},{key
:"Beinwil am See",value
:false},{key
:"Bellikon",value
:false},{key
:"Benzenschwil",value
:false},{key
:"Bergdietikon",value
:false},{key
:"Berikon",value
:false},{key
:"Besenbüren",value
:false},{key
:"Bettwil",value
:false},{key
:"Biberstein",value
:false},{key
:"Birmenstorf (AG)",value
:false},{key
:"Birr",value
:false},{key
:"Birrhard",value
:false},{key
:"Birrwil",value
:false},{key
:"Boniswil",value
:false},{key
:"Boswil",value
:false},{key
:"Bottenwil",value
:false},{key
:"Bremgarten (AG)",value
:false},{key
:"Brittnau",value
:false},{key
:"Brugg",value
:false},{key
:"Brunegg",value
:false},{key
:"Buchs (AG)",value
:false},{key
:"Burg (AG)",value
:false},{key
:"Buttwil",value
:false},{key
:"Böbikon",value
:false},{key
:"Böttstein",value
:false},{key
:"Bözen",value
:false},{key
:"Bünzen",value
:false},{key
:"Buettikon",value
:false},{key
:"Densbueren",value
:false},{key
:"Dietwil",value
:false},{key
:"Dintikon",value
:false},{key
:"Dottikon",value
:false},{key
:"Döttingen",value
:false},{key
:"Dürrenäsch",value
:false},{key
:"Effingen",value
:false},{key
:"Eggenwil",value
:false},{key
:"Egliswil",value
:false},{key
:"Eiken",value
:false},{key
:"Elfingen",value
:false},{key
:"Endingen",value
:false},{key
:"Ennetbaden",value
:false},{key
:"Erlinsbach",value
:false},{key
:"Etzgen",value
:false},{key
:"Fahrwangen",value
:false},{key
:"Fischbach-Goeslikon",value
:false},{key
:"Fisibach",value
:false},{key
:"Fislisbach",value
:false},{key
:"Freienwil",value
:false},{key
:"Frick",value
:false},{key
:"Full-Reuenthal",value
:false},{key
:"Gallenkirch",value
:false},{key
:"Gansingen",value
:false},{key
:"Gebenstorf",value
:false},{key
:"Geltwil",value
:false},{key
:"Gipf-Oberfrick",value
:false},{key
:"Gontenschwil",value
:false},{key
:"Graenichen",value
:false},{key
:"Habsburg",value
:false},{key
:"Hallwil",value
:false},{key
:"Hausen bei Brugg",value
:false},{key
:"Hellikon",value
:false},{key
:"Hendschiken",value
:false},{key
:"Hermetschwil-Staffeln",value
:false},{key
:"Herznach",value
:false},{key
:"Hilfikon",value
:false},{key
:"Hirschthal",value
:false},{key
:"Holderbank (AG)",value
:false},{key
:"Holziken",value
:false},{key
:"Hornussen",value
:true},{key
:"Hottwil",value
:false},{key
:"Hunzenschwil",value
:false},{key
:"Haegglingen",value
:false},{key
:"Islisberg",value
:false},{key
:"Ittenthal",value
:false},{key
:"Jonen",value
:false},{key
:"Kaiseraugst",value
:false},{key
:"Kaiserstuhl",value
:false},{key
:"Kaisten",value
:false},{key
:"Kallern",value
:false},{key
:"Killwangen",value
:false},{key
:"Kirchleerau",value
:false},{key
:"Klingnau",value
:true},{key
:"Koblenz",value
:true},{key
:"Koelliken",value
:false},{key
:"Kuenten",value
:false},{key
:"Kuettigen",value
:false},{key
:"Laufenburg",value
:false},{key
:"Leibstadt",value
:false},{key
:"Leimbach (AG)",value
:false},{key
:"Lengnau (AG)",value
:false},{key
:"Lenzburg",value
:false},{key
:"Leuggern",value
:false},{key
:"Leutwil",value
:false},{key
:"Linn",value
:false},{key
:"Lupfig",value
:false},{key
:"Magden",value
:false},{key
:"Mandach",value
:false},{key
:"Meisterschwanden",value
:false},{key
:"Mellikon",value
:false},{key
:"Mellingen",value
:false},{key
:"Menziken",value
:false},{key
:"Merenschwand",value
:false},{key
:"Mettau",value
:false},{key
:"Moosleerau",value
:false},{key
:"Muhen",value
:false},{key
:"Mumpf",value
:false},{key
:"Murgenthal",value
:false},{key
:"Muri (AG)",value
:false},{key
:"Maegenwil",value
:false},{key
:"Moehlin",value
:false},{key
:"Moenthal",value
:false},{key
:"Moeriken-Wildegg",value
:false},{key
:"Muehlau",value
:false},{key
:"Mühlethal",value
:false},{key
:"Mülligen",value
:false},{key
:"Muenchwilen (AG)",value
:false},{key
:"Neuenhof",value
:false},{key
:"Niederlenz",value
:false},{key
:"Niederrohrdorf",value
:false},{key
:"Niederwil (AG)",value
:false},{key
:"Oberbözberg",value
:false},{key
:"Oberehrendingen",value
:false},{key
:"Oberentfelden",value
:false},{key
:"Oberflachs",value
:false},{key
:"Oberhof",value
:false},{key
:"Oberhofen (AG)",value
:false},{key
:"Oberkulm",value
:false},{key
:"Oberlunkhofen",value
:false},{key
:"Obermumpf",value
:false},{key
:"Oberrohrdorf",value
:false},{key
:"Oberrueti",value
:false},{key
:"Obersiggenthal",value
:false},{key
:"Oberwil-Lieli",value
:false},{key
:"Oeschgen",value
:false},{key
:"Oftringen",value
:true},{key
:"Olsberg",value
:false},{key
:"Othmarsingen",value
:false},{key
:"Reinach (AG)",value
:false},{key
:"Reitnau",value
:false},{key
:"Rekingen (AG)",value
:false},{key
:"Remetschwil",value
:false},{key
:"Remigen",value
:false},{key
:"Rheinfelden",value
:false},{key
:"Rietheim",value
:false},{key
:"Riniken",value
:false},{key
:"Rohr (AG)",value
:false},{key
:"Rothrist",value
:false},{key
:"Rottenschwil",value
:false},{key
:"Rudolfstetten-Friedlisberg",value
:false},{key
:"Rupperswil",value
:false},{key
:"Ruefenach",value
:false},{key
:"Ruemikon",value
:false},{key
:"Safenwil",value
:false},{key
:"Sarmenstorf",value
:false},{key
:"Schafisheim",value
:false},{key
:"Scherz",value
:false},{key
:"Schinznach Bad",value
:false},{key
:"Schinznach Dorf",value
:false},{key
:"Schlossrued",value
:false},{key
:"Schmiedrued",value
:false},{key
:"Schneisingen",value
:false},{key
:"Schupfart",value
:false},{key
:"Schwaderloch",value
:false},{key
:"Schöftland",value
:false},{key
:"Seengen",value
:false},{key
:"Seon",value
:false},{key
:"Siglistorf",value
:false},{key
:"Sins",value
:false},{key
:"Sisseln",value
:false},{key
:"Spreitenbach",value
:false},{key
:"Staffelbach",value
:false},{key
:"Staufen",value
:false},{key
:"Stein (AG)",value
:false},{key
:"Stetten (AG)",value
:false},{key
:"Stilli",value
:false},{key
:"Strengelbach",value
:false},{key
:"Suhr",value
:false},{key
:"Sulz (AG)",value
:false},{key
:"Tegerfelden",value
:false},{key
:"Teufenthal (AG)",value
:false},{key
:"Thalheim (AG)",value
:false},{key
:"Turgi",value
:false},{key
:"Tägerig",value
:false},{key
:"Ueken",value
:false},{key
:"Uerkheim",value
:false},{key
:"Uezwil",value
:false},{key
:"Umiken",value
:false},{key
:"Unterboezberg",value
:false},{key
:"Unterehrendingen",value
:false},{key
:"Unterendingen",value
:false},{key
:"Unterentfelden",value
:false},{key
:"Unterkulm",value
:false},{key
:"Unterlunkhofen",value
:false},{key
:"Untersiggenthal",value
:false},{key
:"Veltheim (AG)",value
:false},{key
:"Villigen",value
:false},{key
:"Villmergen",value
:false},{key
:"Villnachern",value
:false},{key
:"Vordemwald",value
:false},{key
:"Wallbach",value
:false},{key
:"Waltenschwil",value
:false},{key
:"Wegenstetten",value
:false},{key
:"Wettingen",value
:false},{key
:"Widen",value
:false},{key
:"Wil (AG)",value
:false},{key
:"Wiliberg",value
:false},{key
:"Windisch",value
:false},{key
:"Wislikofen",value
:false},{key
:"Wittnau",value
:false},{key
:"Wohlen (AG)",value
:false},{key
:"Wohlenschwil",value
:false},{key
:"Wölflinswil",value
:false},{key
:"Würenlingen",value
:false},{key
:"Würenlos",value
:false},{key
:"Zeihen",value
:false},{key
:"Zeiningen",value
:false},{key
:"Zetzwil",value
:false},{key
:"Zofingen",value
:false},{key
:"Zufikon",value
:false},{key
:"Zurzach",value
:false},{key
:"Zuzgen",value
:false});
23 //usage: var newSelList = new selectionList(groupName,elementsArray,width,xOffset,yOffset,heightNrElements,preSelect,functionToCall);
24 //create an empty group with the id as specified above in parameter 'groupName'
25 comboFruits
= new combobox("fruits","fruits",fruitsGerman
,170,50,50,comboBoxCellHeight
,comboBoxTextpadding
,7,false,0,comboBoxtextStyles
,comboBoxStyles
,comboBoxScrollbarStyles
,comboBoxSmallrectStyles
,comboBoxHighlightStyles
,comboBoxTriangleStyles
,undefined);
26 //selFruits.sortList("asc");
27 var comboRoses
= new combobox("roses","roses",roses
,170,50,300,comboBoxCellHeight
,comboBoxTextpadding
,5,true,50,comboBoxtextStyles
,comboBoxStyles
,comboBoxScrollbarStyles
,comboBoxSmallrectStyles
,comboBoxHighlightStyles
,comboBoxTriangleStyles
,showRoses
);
28 comboFlowers
= new combobox("flowers","flowers",flowers
,170,50,550,comboBoxCellHeight
,comboBoxTextpadding
,8,true,2,comboBoxtextStyles
,comboBoxStyles
,comboBoxScrollbarStyles
,comboBoxSmallrectStyles
,comboBoxHighlightStyles
,comboBoxTriangleStyles
,undefined);
29 var comboCommunitiesAargau
= new combobox("communitiesAarau","communitiesAarau",communitiesAarau
,150,50,200,comboBoxCellHeight
,comboBoxTextpadding
,10,true,25,comboBoxtextStyles
,comboBoxStyles
,comboBoxScrollbarStyles
,comboBoxSmallrectStyles
,comboBoxHighlightStyles
,comboBoxTriangleStyles
,undefined);
30 //select additional elements by name
31 //var additionalElements = new Array({key:"Boswil",value:true},{key:"Brugg",value:true},{key:"Brunegg",value:true},{key:"Buttwil",value:false});
32 //comboCommunitiesAargau.selectElementsByName(additionalElements,false);
33 //select additional elements by index
34 //var additionalElements = new Array({index:0,value:true},{index:2,value:true},{index:4,value:true},{index:6,value:false});
35 //comboCommunitiesAargau.selectElementsByPosition(additionalElements,false);
36 //sort communities desc
37 //comboFruits.sortList("asc");
38 //get current selections
39 //alert(comboCommunitiesAargau.getCurrentSelections().join(","));
40 //get current selections index
41 //alert(comboCommunitiesAargau.getCurrentSelectionsIndex().join(","));
43 //comboCommunitiesAargau.removeCombobox();
45 //var deleteElements = new Array("Boswil","Brugg","Brunegg","Buttwil");
46 //comboCommunitiesAargau.deleteElementsByName(deleteElements,false);
47 //delete element by position, zero based
48 //comboCommunitiesAargau.deleteElementByPosition(1,false);
49 //add element at a certain position
50 //comboCommunitiesAargau.addElementAtPosition({key:"Götzens",value:true},0,false);
51 //add multiple elements alphabetically
52 //var addElementsArray = new Array({key:"Zürich",value:true},{key:"Rickenbach (ZH)",value:true},{key:"Innsbruck",value:false});
53 //comboCommunitiesAargau.addElementsAlphabetically(addElementsArray,"desc",false);
56 function removeSelFlowers() {
57 if (selFlowers
.exists
== true) {
58 selFlowers
.removeSelectionList();
61 alert('selectionList already removed');
65 function showRoses(comboboxName
,selectedValues
,selectedIndizes
) {
66 var rosesString
= selectedValues
.join(",");
67 if (rosesString
.length
== 0) {
70 document
.getElementById("selectedRoses").firstChild
.nodeValue
= rosesString
;