/********************************************************************************************** Nettikartan käyttöliittymä **********************************************************************************************/ //PHP:llä asetettavat muuttujat var ikLan = "fi"; var ikClient = "infogis-pvp"; var ikLocalisePrefix = "https://kartta.jict.fi/infogis-pvp/locale/"; var ikMaps = { "taustakartta": { "mName-fi": "Taustakartta", "mName-en": "Backgroundmap", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("taustakartta", ["https://kartta.jict.fi/wms"], { isBaseLayer: true, LAYERS: 'taustakartta', swLayers: ["infogis:taustakartta_800k","infogis:taustakartta_320k","infogis:taustakartta_160k","infogis:taustakartta_80k","infogis:taustakartta_40k","infogis:taustakartta_20k","infogis:taustakartta_10k","infogis:taustakartta_5k"], SRS: 'EPSG:3067', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2.5,5,12.5,25,50,100,200], transitionEffect: null, projection: "EPSG:3067", displayProjection: "EPSG:3067", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(19995,6556960,739834,7836754) }), mProj: "EPSG:3067", mVisibility: true }, "maastokartta": { "mName-fi": "Maastokartta", "mName-en": "Terrain maps", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("maastokartta", ["https://kartta.jict.fi/wms"], { isBaseLayer: true, LAYERS: 'maastokartta', swLayers: ["infogis:yleiskartta_1m","infogis:yleiskartta_1m","infogis:maastokartta_500k","infogis:maastokartta_250k","infogis:maastokartta_100k","infogis:maastokartta_50k","infogis:peruskartta","infogis:peruskartta","infogis:peruskartta","infogis:peruskartta"], SRS: 'EPSG:3067', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [2,4,10,20,50,100,200,400], transitionEffect: null, projection: "EPSG:3067", displayProjection: "EPSG:3067", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(19995,6556960,739834,7836754) }), mProj: "EPSG:3067", mVisibility: true }, "ortokuva": { "mName-fi": "Ortoilmakuva", "mName-en": "Aerial map", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("ortokuva", ["https://kartta.jict.fi/wms"], { isBaseLayer: true, LAYERS: 'infogis:ortokuva', SRS: 'EPSG:3067', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, resolutions: [0.5,1,2,4,10], transitionEffect: null, projection: "EPSG:3067", displayProjection: "EPSG:3067", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(19995,6556960,739834,7836754) }), mProj: "EPSG:3067", mVisibility: true }, "raahe_keskusta_opaskartta": { "mName-fi": "Raahe Opaskartta", "mName-en": "Raahe Opaskartta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("raahe_keskusta_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'raahe_opaskartta_keskusta', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8,16], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24518673,7170329,24530642,7179620) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_vihanti_opaskartta": { "mName-fi": "Vihanti Opaskartta", "mName-en": "Vihanti Opaskartta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("raahe_vihanti_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'raahe_opaskartta_vihanti', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24546722,7152813,24549003,7155767) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_opaskartta_lampinsaari": { "mName-fi": "Lampinsaari Opask.", "mName-en": "Lampinsaari Opask.", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("raahe_opaskartta_lampinsaari", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'raahe_opaskartta_lampinsaari', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24553579,7145344,24555081,7146701) }), mProj: "EPSG:3878", mVisibility: false }, "haapajarvi_asemakaava": { "mName-fi": "Haapajarvi Asemakaava", "mName-en": "Haapajarvi Asemakaava", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("haapajarvi_asemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'haapajarvi_asemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.4633,1,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2564248,7069740,2567648,7075884) }), mProj: "EPSG:2392", mVisibility: false }, "haapajarvi_keskusta_sauviinmaki_oyk": { "mName-fi": "Keskusta-Sauviinmaki", "mName-en": "Keskusta-Sauviinmaki", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("haapajarvi_keskusta_sauviinmaki_oyk", ["https://paikkatieto.sweco.fi/wms/haapajarvi/kaavayhdistelma/oyk"], { isBaseLayer: true, // ikAutoChangeLayer: "taustakartta", LAYERS: 'keskusta_sauviinmaki_oyk', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [1,2,4,8,16,32], projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(2561410,7069730,2570600,7075940) }), mProj: "EPSG:2392", mVisibility: false }, "haapajarvi_ristiniitty_oyk": { "mName-fi": "Ristiniitty", "mName-en": "Ristiniitty", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("haapajarvi_ristiniitty_oyk", ["https://paikkatieto.sweco.fi/wms/haapajarvi/kaavayhdistelma/oyk"], { isBaseLayer: true, // ikAutoChangeLayer: "taustakartta", LAYERS: 'ristiniitty_oyk', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [1,2,4,8], projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(2574434,7080732,2579106,7084444) }), mProj: "EPSG:2392", mVisibility: false }, "haapajarvi_valikangas_oyk": { "mName-fi": "Valikangas", "mName-en": "Valikangas", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("haapajarvi_valikangas_oyk", ["https://paikkatieto.sweco.fi/wms/haapajarvi/kaavayhdistelma/oyk"], { isBaseLayer: true, // ikAutoChangeLayer: "taustakartta", LAYERS: 'valikangas_oyk', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [1,2,4,8], projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(2577940,7073800,2581800,7079360) }), mProj: "EPSG:2392", mVisibility: false }, "pyhajoki_oyk": { "mName-fi": "Pyhajoki OYK", "mName-en": "Pyhajoki OYK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("pyhajoki_oyk", ["https://paikkatieto.airix.fi/paikkatieto/pyhajoki/oyk/oyk.py?kartta=oyk"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'oyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [1,2,4,8,16,32,64], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24491772,7138000,24525227,7161000) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_oyk": { "mName-fi": "Raahe OYK", "mName-en": "Raahe OYK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("raahe_oyk", ["https://paikkatieto.sweco.fi/wms/raahe/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Osayleiskaavayhdistelmä', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [1,2,4,8,16,32,64], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24503100,7134790,24585000,7190990) }), mProj: "EPSG:3878", mVisibility: false }, "pyhajoki_hanhikivi_ak": { "mName-fi": "Hanhikivi AK", "mName-en": "Hanhikivi AK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("pyhajoki_hanhikivi_ak", ["https://paikkatieto.sweco.fi/wms/raahe/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'ydinvoimalaitosalue', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24511166,7157362,24516658,7160451) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_kultakaivos_ak": { "mName-fi": "Kultakaivos AK", "mName-en": "Kultakaivos AK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("raahe_kultakaivos_ak", ["https://paikkatieto.sweco.fi/wms/raahe/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kultakaivos', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24527689,7160747,24529467,7161970) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_hanhikivi_ak": { "mName-fi": "Hanhikivi AK", "mName-en": "Hanhikivi AK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("raahe_hanhikivi_ak", ["https://www.paikkatieto.airix.fi/paikkatieto/raahe/ak/krysp/hanhikivi/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24511407,7158621,24513825,7160283) }), mProj: "EPSG:3878", mVisibility: false }, "siikajoki_keskikyla_kaavayhdistelma": { "mName-fi": "Siikajoki keskikyla", "mName-en": "Siikajoki keskikyla", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikajoki_keskikyla_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikajoki/krysp/keskikyla/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24534587,7189914,24537475,7191899) }), mProj: "EPSG:3878", mVisibility: false }, "siikajoki_revonlahti_kaavayhdistelma": { "mName-fi": "Siikajoki revonlahti", "mName-en": "Siikajoki revonlahti", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikajoki_revonlahti_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikajoki/krysp/revonlahti/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24543831,7178290,24547609,7180887) }), mProj: "EPSG:3878", mVisibility: false }, "siikajoki_ruukki_kaavayhdistelma": { "mName-fi": "Siikajoki ruukki", "mName-en": "Siikajoki ruukki", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikajoki_ruukki_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikajoki/krysp/ruukki/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24550132,7171818,24555569,7175556) }), mProj: "EPSG:3878", mVisibility: false }, "siikajoki_paavola_kaavayhdistelma": { "mName-fi": "Siikajoki paavola", "mName-en": "Siikajoki paavola", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikajoki_paavola_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikajoki/krysp/paavola/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24556173,7167295,24558736,7169057) }), mProj: "EPSG:3878", mVisibility: false }, "siikajoki_tauvo_kaavayhdistelma": { "mName-fi": "Siikajoki tauvo", "mName-en": "Siikajoki tauvo", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikajoki_tauvo_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikajoki/krysp/tauvo/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24525630,7189068,24527642,7190451) }), mProj: "EPSG:3878", mVisibility: false }, "siikalatva_rantsila_kaavayhdistelma": { "mName-fi": "Siikalatva Rantsila", "mName-en": "Siikalatva Rantsila", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikalatva_rantsila_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikalatva/krysp/rantsila/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2393', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(3432718,7156270,3438155,7160008) }), mProj: "EPSG:2393", mVisibility: false }, "siikalatva_kestila_kaavayhdistelma": { "mName-fi": "Siikalatva Kestila", "mName-en": "Siikalatva Kestila", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikalatva_kestila_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikalatva/krysp/kestila/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2393', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(3463534,7137986,3466472,7140005) }), mProj: "EPSG:2393", mVisibility: false }, "siikalatva_leskela_kaavayhdistelma": { "mName-fi": "Siikalatva Leskela", "mName-en": "Siikalatva Leskela", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikalatva_leskela_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikalatva/krysp/leskela/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2393', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2], projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(3441914,7120508,3443111,7121331) }), mProj: "EPSG:2393", mVisibility: false }, "siikalatva_pulkkila_kaavayhdistelma": { "mName-fi": "Siikalatva Pulkkila", "mName-en": "Siikalatva Pulkkila", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikalatva_pulkkila_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikalatva/krysp/pulkkila/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2393', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(3442179,7129162,3447856,7133065) }), mProj: "EPSG:2393", mVisibility: false }, "siikalatva_piippola_kaavayhdistelma": { "mName-fi": "Siikalatva Piippola", "mName-en": "Siikalatva Piippola", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("siikalatva_piippola_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/siikalatva/krysp/piippola/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2393', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4], projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(3448071,7119054,3451256,7121244) }), mProj: "EPSG:2393", mVisibility: false }, "pyhajoki_keskusta_kaavayhdistelma": { "mName-fi": "Pyhäjoki kaavayhd.", "mName-en": "Pyhäjoki kaavayhd.", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("pyhajoki_keskusta_kaavayhdistelma", ["https://www.paikkatieto.airix.fi/paikkatieto/pyhajoki/keskusta/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24509807,7150449,24515784,7154558) }), mProj: "EPSG:3878", mVisibility: false }, "sievi_kirkonkyla_opaskartta": { "mName-fi": "Kirkonkylä", "mName-en": "Kirkonkylä", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("sievi_kirkonkyla_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'sievi_kirkonkyla_opaskartta', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.436280614362806,3,6], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2523741,7087460,2527354,7090671) }), mProj: "EPSG:2392", mVisibility: false }, "sievi_asemakyla_opaskartta": { "mName-fi": "Asemakylä", "mName-en": "Asemakylä", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("sievi_asemakyla_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'sievi_asemakyla_opaskartta', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.5,3,6], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2513182,7095989,2515270,7099001) }), mProj: "EPSG:2392", mVisibility: false }, "sievi_keskusta_kaava": { "mName-fi": "Sievi kaava", "mName-en": "Sievi kaava", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("sievi_keskusta_kaava", ["https://paikkatieto.sweco.fi/wms/sievi/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'ky_keskusta', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24524100,7087420,24526700,7090420) }), mProj: "EPSG:3878", mVisibility: false }, "sievi_asemanseutu_kaava": { "mName-fi": "Sievi-Asemanseutu", "mName-en": "Sievi-Asemanseutu", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("sievi_asemanseutu_kaava", ["https://paikkatieto.sweco.fi/wms/sievi/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'ky_asemanseutu', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24513300,7096700,24514700,7098430) }), mProj: "EPSG:3878", mVisibility: false }, "alavieska_kaava": { "mName-fi": "Alavieska kaava", "mName-en": "Alavieska kaava", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("alavieska_kaava", ["https://www.paikkatieto.airix.fi/paikkatieto/alavieska/krysp/krysp.py"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'Kaavayhdistelma', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(2513714,7117100,2517015,7119370) }), mProj: "EPSG:2392", mVisibility: false }, "raahe_vihanti_kaava": { "mName-fi": "Raahe-Vihanti AK", "mName-en": "Raahe-Vihanti AK", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("raahe_vihanti_kaava", ["https://paikkatieto.sweco.fi/wms/raahe/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'ak_ky_vihanti', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24544760,7152562,24550430,7156460) }), mProj: "EPSG:3878", mVisibility: false }, "raahe_kaava": { "mName-fi": "Raahe Kaava", "mName-en": "Raahe Kaava", mNaviMapPref: "Infokartta2", mLayer: new OpenLayers.Layer.WMSik("raahe_kaava", ["https://paikkatieto.sweco.fi/wms/raahe/kartta"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'ak_ky_raahe', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', visibility: true }, { resolutions: [0.5,1,2,4,8], projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, maxExtent: new OpenLayers.Bounds(24516325,7169412,24531997,7180186) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_keskusta_opaskartta": { "mName-fi": "Keskusta", "mName-en": "Keskusta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_keskusta_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_keskusta_opaskartta', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.26995042278287,2.53990084556574,5.07980169113148,10.15960338226296,20.31920676452592], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24484019,7121057,24500719,7134357) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_lestijokilaakso": { "mName-fi": "Lestijokilaakso", "mName-en": "Lestijokilaakso", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_lestijokilaakso", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_lestijokilaakso', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.015965,2.031930,4.063860,8.127720], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24482000,7098000,24489000,7107000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_oyk_mokkipera_pahkamaa": { "mName-fi": "OYK Mokkipera-Pahkamaa", "mName-en": "OYK Mokkipera-Pahkamaa", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_oyk_mokkipera_pahkamaa", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_oyk_mokkipera_pahkamaa', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.01598,2.03196,4.06392,8.12784,16.25568,32.51136], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24498500,7097500,24509500,7112500) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_himanka_opaskartta": { "mName-fi": "Himanka", "mName-en": "Himanka", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_himanka_opaskartta", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_himanka_opaskartta', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.27002098874903,2.54004197749806,5.08008395499612,10.16016790999224,20.32033581998448], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2479500,7103089,2485439,7111500) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_lantinenoyk": { "mName-fi": "LäntinenOYK", "mName-en": "LäntinenOYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_juurakkooyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_lantinenoyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.01603,2.03206,4.06412,8.12824], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24493000,7117000,24502000,7126000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_juurakkooyk": { "mName-fi": "Juurakko", "mName-en": "Juurakko", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_juurakkooyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_juurakkooyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24502999,7134000,24506999,7139000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_alaviirtenlahdenoyk": { "mName-fi": "Alaviirteenlahti", "mName-en": "Alaviirteenlahti", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_alaviirtenlahdenoyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_alaviirtenlahdenoyk', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2474999,7108220,2479723,7112000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Etelaniemenranta-asemakaa": { "mName-fi": "Eteläniemi", "mName-en": "Eteläniemi", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Etelaniemenranta-asemakaa", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Etelaniemenranta-asemakaa', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5079825834542816,1,2], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2479699,7110776,2481022,7113800) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_himanganrantaoyk": { "mName-fi": "Himanganranta", "mName-en": "Himanganranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_himanganrantaoyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_himanganrantaoyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.01595,2.03190,4.06380,8.12760], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24476000,7104500,24486000,7122000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_kannuskylaoyk": { "mName-fi": "Kannuskylä", "mName-en": "Kannuskylä", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_kannuskylaoyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_kannuskylaoyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.01574,2.03148,4.06296,8.12592], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24481500,7103500,24483500,7106000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_karmekalliooyk": { "mName-fi": "Kärmekallio", "mName-en": "Kärmekallio", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_karmekalliooyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_karmekalliooyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.01585,2.03170,4.06340,8.12680], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24483000,7105500,24485500,7108000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_Himanganasemakaava": { "mName-fi": "Himanka", "mName-en": "Himanka", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Himanganasemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Himanganasemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.50799,1.01598,2.03196,4.06392], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2481999,7106000,2485399,7109000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_JokelantuulipuistonOYK": { "mName-fi": "Jokelantuulipuisto", "mName-en": "Jokelantuulipuisto", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_JokelantuulipuistonOYK", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_JokelantuulipuistonOYK', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.058201058201058,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2497499,7133301,2500499,7136000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_hiekkasarkat_asemakaava": { "mName-fi": "Hiekkasärkät", "mName-en": "Hiekkasärkät", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_hiekkasarkat_asemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_hiekkasarkat_asemakaava', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.50801,1.01602,2.03204,4.06408,8.12816], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24487500,7123500,24494000,7128500) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_Kannuskylanasemakaava": { "mName-fi": "Kannuskylä", "mName-en": "Kannuskylä", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Kannuskylanasemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Kannuskylanasemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5079580088046055,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2481899,7104300,2483399,7106000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_pikkumansikka_oyk": { "mName-fi": "PikkumansikkaOYK", "mName-en": "PikkumansikkaOYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_pikkumansikka_oyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_pikkumansikkaoyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24479000,7109000,24481500,7111000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_mustilankangas_oyk": { "mName-fi": "MustilankangasOYK", "mName-en": "MustilankangasOYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_mustilankangas_oyk", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_mustilankangas_oyk', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24498999,7126000,24506999,7133000) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_KirkonseudunOYK": { "mName-fi": "KirkonseutuOYK", "mName-en": "KirkonseutuOYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_KirkonseudunOYK", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_KirkonseudunOYK', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.26998029340924,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2494399,7126401,2500199,7132400) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_kirkonseutu_asemakaava": { "mName-fi": "Kirkonseutu AK", "mName-en": "Kirkonseutu AK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_kirkonseutu_asemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_kirkonseutu_asemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.50801094,1,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2495499,7122195,2502869,7132400) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_kj_vasank_kaava": { "mName-fi": "Kalajokisuu-Vasankari", "mName-en": "Kalajokisuu-Vasankari", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_kj_vasank_kaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_kj_vasank_kaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2495999,7131201,2497599,7138200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Lapinluodonkankaanranta-a": { "mName-fi": "Lapinluodonkangas", "mName-en": "Lapinluodonkangas", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Lapinluodonkankaanranta-a", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Lapinluodonkankaanranta-a', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2482999,7114900,2483899,7116100) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_leton_kaava": { "mName-fi": "Leton kaava", "mName-en": "Leton kaava", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_leton_kaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_leton_kaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291588578987984,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2491199,7128700,2495999,7132600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_maitomaki_ympsuunn": { "mName-fi": "Maitomäki", "mName-en": "Maitomäki", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_maitomaki_ympsuunn", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_maitomaki_ympsuunn', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5323868677905945,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2487999,7121400,2488599,7122000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_MakikankaantuulipuistonOY": { "mName-fi": "Mäkikangas", "mName-en": "Mäkikangas", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_MakikankaantuulipuistonOY", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_MakikankaantuulipuistonOY', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.058425063505504,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2500499,7139000,2505499,7141700) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_MeinalanasemakaavaUUSI": { "mName-fi": "Meinala", "mName-en": "Meinala", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_MeinalanasemakaavaUUSI", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_MeinalanasemakaavaUUSI', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.53166897827092,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2493399,7126693,2495710,7128000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Meri-Himanganranta-asemak": { "mName-fi": "Meri-Himanganranta", "mName-en": "Meri-Himanganranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Meri-Himanganranta-asemak", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Meri-Himanganranta-asemak', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2481399,7107800,2482599,7109600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Mustilanranta-asemakaava": { "mName-fi": "Mustilanranta", "mName-en": "Mustilanranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Mustilanranta-asemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Mustilanranta-asemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2481799,7114800,2482999,7116200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pikku-Mansikanasemakaava": { "mName-fi": "Pikku-Mansikka", "mName-en": "Pikku-Mansikka", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pikku-Mansikanasemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pikku-Mansikanasemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2479599,7109400,2480899,7110700) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pitkajarvenranta-asemakaa": { "mName-fi": "Pitkäjärvenranta", "mName-en": "Pitkäjärvenranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pitkajarvenranta-asemakaa", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pitkajarvenranta-asemakaa', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2497499,7111300,2499499,7112900) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pohjanpaanranta1": { "mName-fi": "Pohjanpää 1", "mName-en": "Pohjanpää 1", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pohjanpaanranta1", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pohjanpaanranta1', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5292171995589857,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2483399,7116200,2485799,7119200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pohjanpaanranta-asemak_2": { "mName-fi": "Pohjanpää 2", "mName-en": "Pohjanpää 2", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pohjanpaanranta-asemak_2", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pohjanpaanranta-asemak_2', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291742097200947,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2479199,7119800,2482999,7122400) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pohjanpaanranta-asemak_3": { "mName-fi": "Pohjanpää 3", "mName-en": "Pohjanpää 3", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pohjanpaanranta-asemak_3", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pohjanpaanranta-asemak_3', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5292005292005292,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2480799,7115800,2483599,7118600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Pohjanpaanranta-asemak_4": { "mName-fi": "Pohjanpää 4", "mName-en": "Pohjanpää 4", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Pohjanpaanranta-asemak_4", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Pohjanpaanranta-asemak_4', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5292171995589857,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2482999,7117600,2485399,7120600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Rahjanasemakaava": { "mName-fi": "Rahja AK", "mName-en": "Rahja AK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Rahjanasemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Rahjanasemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5292005292005292,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2484399,7123400,2487199,7125600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Rahjankylanosayleiskaava": { "mName-fi": "Rahjankylä OYK", "mName-en": "Rahjankylä OYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Rahjankylanosayleiskaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Rahjankylanosayleiskaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.270129281016103,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2484599,7117000,2490199,7125200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_rahjan_rantakaava": { "mName-fi": "Rahja rantakaava", "mName-en": "Rahja rantakaava", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_rahjan_rantakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_rahjan_rantakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5286809410520751,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2484999,7118999,2486999,7122000) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_rahja_saaristokaava": { "mName-fi": "Rahja saaristokaava", "mName-en": "Rahja saaristokaava", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_rahja_saaristokaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_rahja_saaristokaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5292171995589857,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2483999,7119999,2486399,7121600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_RantaharjualueenOYK": { "mName-fi": "Rantaharju OYK", "mName-en": "Rantaharju OYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_RantaharjualueenOYK", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_RantaharjualueenOYK', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.27003326277593,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2487799,7123401,2496199,7132800) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_rautio_kaava": { "mName-fi": "Rautio", "mName-en": "Rautio", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_rautio_kaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_rautio_kaava', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5079365,1.0158730,2.0317460,4.0634920], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24509200,7107400,24510800,7108800) }), mProj: "EPSG:3878", mVisibility: false }, "kalajoki_satama_kaava": { "mName-fi": "Satama/Lomaranta", "mName-en": "Satama/Lomaranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_satama_kaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_satama_kaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.058401058401058,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2484399,7123400,2489999,7125600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Sipinperanranta-asemakaav": { "mName-fi": "Sipinperä", "mName-en": "Sipinperä", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Sipinperanranta-asemakaav", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Sipinperanranta-asemakaav', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2482199,7112800,2482999,7114600) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_TohkojantuulipuistonOYK": { "mName-fi": "Tohkojantuulipuisto", "mName-en": "Tohkojantuulipuisto", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_TohkojantuulipuistonOYK", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_TohkojantuulipuistonOYK', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1.058361052313275,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2496999,7132000,2503999,7137500) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Tynganasemakaava": { "mName-fi": "Tyngan AK", "mName-en": "Tyngan AK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Tynganasemakaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Tynganasemakaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.5291005291005291,1,2,4], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2502999,7121800,2504599,7123200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Vasankarinosayleiskaava": { "mName-fi": "Vasankari OYK", "mName-en": "Vasankari OYK", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Vasankarinosayleiskaava", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Vasankarinosayleiskaava', SRS: 'EPSG:2392', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [1,2,4,8], transitionEffect: null, projection: "EPSG:2392", displayProjection: "EPSG:2392", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(2496599,7135964,2502268,7142200) }), mProj: "EPSG:2392", mVisibility: false }, "kalajoki_Virpirannanranta-asemakaa": { "mName-fi": "Virpiranta", "mName-en": "Virpiranta", mNaviMapPref: "Infokartta", mLayer: new OpenLayers.Layer.WMSik("kalajoki_Virpirannanranta-asemakaa", ["https://kartta.jict.fi/geoserver/infogis/wms"], { isBaseLayer: true, ikAutoChangeLayer: "taustakartta", LAYERS: 'kalajoki_Virpirannanranta-asemakaa', SRS: 'EPSG:3878', STYLES: '', format: 'image/png', tiled: true, visibility: true }, { buffer: 0, opacity: 60, resolutions: [0.50804,1.01608,2.03216,4.06432], transitionEffect: null, projection: "EPSG:3878", displayProjection: "EPSG:3878", displayOutsideMaxExtent: true, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(24479800,7109000,24481600,7111200) }), mProj: "EPSG:3878", mVisibility: false } }; var ikNaviMaps = { "Infokartta": { mLayer: new OpenLayers.Layer.WMS("Infokartta", ["https://kartta.jict.fi/wms"], { LAYERS: 'kainuu_opastus', SRS: 'EPSG:2393', STYLES: '', format: 'image/jpeg', tiled: true }, { buffer: 0, projection: "EPSG:2393", displayProjection: "EPSG:2393", displayOutsideMaxExtent: false, tileSize: new OpenLayers.Size(256,256), maxExtent: new OpenLayers.Bounds(3055988.9993335,6596774.0016665,3740718.1303415,7785398.754306501) }) } }; //Näkyvyysvakiot var V_OFF = 0; var V_SHOWN = 1; var V_HIDDEN = 2; //Kontrollien globaalit kokomuuttujat: var TrgtTreeWidth = 300; var RightPanelWidth = 250; var TrgtTitleHeight = 30; //Legacy: var ControlsTitleHeight = 0; //Odotetaan, että koordinaattimuutosluokat on alustettu var s = new OpenLayers.Projection("EPSG:3067"); var tried = 0; while(s.getUnits == null && tried <= 10) { sleep(500); tried++; } var forceLocal = false; /************************************************************************************* Karttakäyttöliittymä-luokka. name: String - legacya, ei käytetä missään. options: Object - käyttöliittymän asetukset ja niiden oletusarvot: leftControl: V_SHOWN,- Vasemman panelin näkyvyys useRightControl: true,- Oikean paneelin näkyvyys showMiniToolPanel: true, - Yläosan työkalu/branding -paneelin käyttö useWhiteToolButtons: false, - Käytetäänkö valkoisia työkalupainikkeita (suurimmalla osalla true) brandingWidth: null, - Yläpalkin branding-osion oletuksesta poikkeava leveys tools: ["measure","coordinate","print","link","feedback", "lan-select"], - Näytettävät työkalut mobileTools: [], - Mobiilissa näytettävät työkalut useRouteMeasureTool: true, - Reitinmittaustyökalun käyttö coordListUrl: null, - Koordinaattilistauksen, panelinäytölle vaihtoehtoinen, url (Planora) coordListUrlProj: null, - Projektio edelliseen langs: ["fi", "en"], - Kielivalinnan kielet forceLocal: true, - Localisoinnin pakotus sivua ladattaessa (myös suomeksi) showTrgtTree: true, - Kohdepuu käytössä? showSearch: true, - Haku käytössä? showMapSelection: true, - Karttavalinta käytössä? showHelp: V_HIDDEN, - Ohjeen näkyvyys avattaessa altInfoPanel: undefined, - Vaihtoehtoisen Infopanelin ID autoShowInfoPanel: true, - Näytetäänkö infopaneli automaattisesti kun info ladataan showCountySelect: true, - Näytetäänkö kuntavalinta? showThemeSelect: true, - Näytetäänkö teemavalinta? socialNetworks: ['facebook','pinterest','googleplus','twitter','linkedin','tumblr','in1','email','stumbleupon','digg'], - SoMe-plugin näytettävät valinnat (karttalinkkityökalussa) coordTool: { selection: { "ETRS-TM35FIN": new CommonCoordObj("ETRS-TM35FIN", "EPSG:3067"), "YKJ": new CommonCoordObj("YKJ", "EPSG:2393"), "KKJ1": new CommonCoordObj("KKJ1", "EPSG:2391"), "KKJ2": new CommonCoordObj("KKJ2", "EPSG:2392"), "KKJ3": new CommonCoordObj("KKJ3", "EPSG:2393"), "KKJ4": new CommonCoordObj("KKJ4", "EPSG:2394") }, selected: "ETRS-TM35FIN", showWGS84: true }, - Koordinaattityökalun asetukset: Koordinaattiobjektit, oletus, WGS84:n näyttö mobile: false, - Onko mobiili (asetetaan php:llä) oldMobile: false, - Onko antiikkinen mobiililaite (myös php:llä) buttonLinkUrl: null, - Suurennuslinkin url containerId: "" - Kartta-containerin ID *************************************************************************************/ function infoGUI(name, options, mapOptions) { this.addHashSelection = AddHashSelection; this.createHashLink = CreateHashLink; this.createLeftPanel = CreateLeftPanel; this.createRightPanel = CreateRightPanel; this.toggleRightPanel = ToggleRightPanel; this.printFormChanged = PrintFormChanged; this.showSavedLinks = ShowSavedLinks; this.showPrintTool = ShowPrintTool; this.showRouteMeasureTool = ShowRouteMeasureTool; this.showMeasureTool = ShowMeasureTool; this.showCoordTool = ShowCoordTool; this.showInfoPanel = ShowInfoPanel; this.showNoInfoPanel = ShowNoInfoPanel; this.showHelpPanel = ShowHelpPanel; this.adjustRPLowerPanels = AdjustRPLowerPanels; this.createLeftOverPanel = CreateLeftOverPanel; this.createPopPanel = CreatePopPanel; this.createSaveLinkView = CreateSaveLinkView; this.updateSaveLinkList = UpdateSaveLinkList; this.updateCoordForms = UpdateCoordForms; this.setMarkControlCc = SetMarkControlCc; this.setMarkControlWGS = SetMarkControlWGS; this.selectMap = SelectMap; this.baseLayerChanged = BaseLayerChanged; this.setZoomBarPos = SetZoomBarPos; this.markSelected = MarkSelected; this.clearGroup = ClearGroup; this.showUsrTrgtMessage = ShowUsrTrgtMessage; this.selectUsrTarget = SelectUsrTarget; this.selectTarget = SelectTarget; this.checkUsrTarget = CheckUsrTarget; this.checkTarget = CheckTarget; this.checkParents = CheckParents; this.checkGroup = CheckGroup; this.customSearchTargetCount = CustomSearchTargetCount; this.loadSearchTargets = LoadSearchTargets; this.loadTargets = LoadTargets; this.handleTargets = HandleTargets; this.loadTrgtInfo = LoadTrgtInfo; this.handleTrgtInfo = HandleTrgtInfo; this.loadCounties = LoadCounties; this.handleCounties = HandleCounties; this.loadThemes = LoadThemes; this.handleThemes = HandleThemes; this.loadTinyUrl = LoadTinyUrl; this.handleTinyUrl = HandleTinyUrl; this.loadHelp = LoadHelp; this.handleHelp = HandleHelp; this.submitFeedback = SubmitFeedback; this.changeLanguage = ChangeLanguage; this.getCookieLinks = GetCookieLinks; this.deleteCookieLink = DeleteCookieLink; this.trgtsToSelect = ""; this.selectedSearch = {}; this.addrsOnMap = {}; this.selCounty = ""; this.selectCounty = SelectCounty; this.selTheme = ""; this.selectTheme = SelectTheme; this.setRoutes = []; this.waitingGroups = []; this.hashGroups = []; this.trgtBuffer = []; this.trgtLoadCounter = {}; this.name = name; this.settings = { leftControl: V_SHOWN, useRightControl: true, showMiniToolPanel: true, useWhiteToolButtons: false, brandingWidth: null, tools: ["measure","coordinate","print","link","feedback", "lan-select"], mobileTools: [], useRouteMeasureTool: true, coordListUrl: null, coordListUrlProj: null, langs: ["fi", "en"], forceLocal: true, showTrgtTree: true, showSearch: true, showMapSelection: true, showHelp: V_HIDDEN, altInfoPanel: undefined, autoShowInfoPanel: true, showCountySelect: true, selCounty: "", // pauli showThemeSelect: true, socialNetworks: ['facebook','pinterest','googleplus','twitter','linkedin','tumblr','in1','email','stumbleupon','digg'], coordTool: { selection: { "ETRS-TM35FIN": new CommonCoordObj("ETRS-TM35FIN", "EPSG:3067"), "YKJ": new CommonCoordObj("YKJ", "EPSG:2393"), "KKJ1": new CommonCoordObj("KKJ1", "EPSG:2391"), "KKJ2": new CommonCoordObj("KKJ2", "EPSG:2392"), "KKJ3": new CommonCoordObj("KKJ3", "EPSG:2393"), "KKJ4": new CommonCoordObj("KKJ4", "EPSG:2394") }, selected: "ETRS-TM35FIN", showWGS84: true }, mobile: false, oldMobile: false, buttonLinkUrl: null, containerId: "" }; if(options) { for(var property in options) { var value = options[property]; if(value !== undefined) { this.settings[property] = value; } } } forceLocal = this.settings.forceLocal; var guiObj = this; guiObj.selCounty = this.settings.selCounty; // pauli this.onWindowResize = OnWindowResize; this.toggleTrgtTree = ToggleTrgtTree; this.adjustSearchCont = AdjustSearchCont; this.leftPanelVisible = true; if(this.settings.leftControl == V_OFF) this.leftPanelVisible = false; this.getLeftPanelVisibleWidth = GetLeftPanelVisibleWidth; this.getRightPanelVisibleWidth = GetRightPanelVisibleWidth; if(this.settings.containerId == undefined || this.settings.containerId == "" || $("#"+this.settings.containerId).length != 1) { alert("Set a container with a unique id."); } else { /* Support testaukseen: console.log(jQuery.support.ajax); console.log(jQuery.support.boxModel ); console.log(jQuery.support.changeBubbles );//ie8 console.log(jQuery.support.checkClone ); console.log(jQuery.support.checkOn ); console.log(jQuery.support.cors );//ie9//ie8 console.log(jQuery.support.cssFloat );//ie8 console.log(jQuery.support.hrefNormalized ); console.log(jQuery.support.htmlSerialize );//ie8 console.log(jQuery.support.leadingWhitespace );//ie8 console.log(jQuery.support.noCloneChecked );//ie9//ie8 console.log(jQuery.support.noCloneEvent );//ie8 console.log(jQuery.support.opacity );//ie8 console.log(jQuery.support.optDisabled ); console.log(jQuery.support.optSelected );//ie9//ie8 console.log(jQuery.support.style );//ie8 console.log(jQuery.support.submitBubbles );//ie8 console.log(jQuery.support.tbody );*/ if(top.name.indexOf('_ikrl')==-1 && !jQuery.support.optSelected) { top.name += "_ikrl"; window.location.reload(); } else { top.name = ""; } $("#"+this.settings.containerId).addClass("ikMapGuiContainer"); if(this.settings.mobile) { $('head meta[name=viewport]').remove(); $('head').prepend(''); $(".ikMapGuiContainer").css({"font-size": "1.3em"}); $(".ikMapGuiContainer").addClass("igMobile"); if(this.settings.oldMobile)$(".ikMapGuiContainer").addClass("igOldMobile"); } $(document).on("focusin", ".ikField", function() { var input = $(this); setTimeout(function(n) {try{ n.select();}catch(e){} }, 10, this); if(input.val() == input.attr("placeholder")) { input.val(""); } }).on("blur", ".ikField", function() { var input = $(this); if (input.val() == "" || !input.val() ) { input.val(input.attr("placeholder")); } }).on("click", ".ikDeleteSlink", function() { var lRow = $(this).closest(".sLinkRow"); var conf = confirm($(this).attr("alt")+" "+$(lRow).find("a:first").text()+"?"); if(conf) { guiObj.deleteCookieLink($(lRow).data("raw_link")); //$(lRow).remove(); guiObj.updateSaveLinkList(); if($(".sLinkRow").length == 0 && $("#ikLinkOptCont").length == 0) guiObj.showSavedLinks(false); } }); $(document).on("click", ".ikXmarks", function() { guiObj.clearGroup(this); return false; }); //Kartan luonti------------------------------------------------------------------------------------------- this.infokOlMap = new infokartta(this.settings.containerId, mapOptions, this); $("
").appendTo("#"+this.settings.containerId); //Kiinnitetään ikkunan Window resize: $(window).resize(this.onWindowResize); //Työkalupaneelin luonti: var toolArray = this.settings.mobile? this.settings.mobileTools:this.settings.tools; if(this.settings.showMiniToolPanel && toolArray) { var toolButtons = ""; if($.inArray("measure", toolArray) > -1) toolButtons += "
"; if($.inArray("area", toolArray) > -1) toolButtons += "
"; if($.inArray("coordinate", toolArray) > -1) toolButtons += "
"; if($.inArray("dim", toolArray) > -1) toolButtons += "
"; if($.inArray("print", toolArray) > -1) toolButtons += "
"; if($.inArray("link", toolArray) > -1) toolButtons += "
"; if($.inArray("feedback", toolArray) > -1) toolButtons += "
"; if($.inArray("lan-select", toolArray) > -1) toolButtons += "
"; var ttW = guiObj.getLeftPanelVisibleWidth(); var brandW = guiObj.settings.brandingWidth || 134; var mapW = $(".ikMapGuiContainer").width(); var lPos = (mapW/2 + TrgtTreeWidth/2 - (32*toolArray.length+brandW+24)/2 - RightPanelWidth/2); if(lPos < TrgtTreeWidth+30 && lPos + (32*toolArray.length+brandW+24) <= mapW) lPos = TrgtTreeWidth+30; if(guiObj.settings.mobile) lPos = mapW/2 - (32*toolArray.length+brandW+24)/2; lPos = lPos.toFixed(0); $("
"+toolButtons+"
").appendTo("#"+guiObj.settings.containerId).sticky( { draggable: false, top: "0px", height: "56px", background: "transparent", fade: "false", "z-index": "99980", fade_opacity: "1.0", width: (32*toolArray.length+brandW+24)+"px", left: lPos+"px", onclose: function() { return true;}}); //$("#ikMiniContPanel", ".ikMapGuiContainer").css({overflow: "hidden", border: "none"}); if(this.settings.useWhiteToolButtons) $("#ikMCLeft").addClass("ikWhite"); $("#ikMCLeft").css({width: (toolArray.length*32+24)+"px"}); if(guiObj.settings.brandingWidth)$("#ikMCRight").css({width: guiObj.settings.brandingWidth+"px"}); $("#ikMiniContPanel .sticky-close").hide(); $("div.ikPathMeasureControl").css({left: ($.inArray("measure", toolArray)*32+12)+"px"}); $("div.ikAreaMeasureControl").css({left: ($.inArray("area", toolArray)*32+12)+"px"}); $("div.ikMarkControl").css({left: ($.inArray("coordinate", toolArray)*32+12)+"px"}); $("div.ikDimControl").css({left: ($.inArray("dim", toolArray)*32+12)+"px"}); $("div.ikPrintControl").css({left: ($.inArray("print", toolArray)*32+12)+"px"}); $("div.ikLinkControl").css({left: ($.inArray("link",toolArray)*32+12)+"px"}); $("div.ikFeedbackControl").css({left: ($.inArray("feedback", toolArray)*32+12)+"px"}); $("div.ikLanSelect").css({left: ($.inArray("lan-select", toolArray)*32+12)+"px"}); } //GPS-nappula: if(this.settings.mobile) { $("
").appendTo("#"+this.settings.containerId).sticky( { draggable: false, bottom: "30px", left: "20px", height: "44px", width: "44px", background: "transparent url(/codebase-infogis/release/style/img/GPS-keskitys-on.png) no-repeat left top", fade: "false", fade_opacity: "1.0", onclose: function() { return false;} }); $("#ikGPSCenterButtonCont .sticky-close").hide(); $("#ikGPSCenterButtonCont").click(function() {guiObj.infokOlMap.centerToUserLocation(); return false; }); } this.createLeftPanel(this.settings.leftControl == V_OFF); if(this.settings.leftControl == V_OFF) { TrgtTreeWidth = 0; if(!this.settings.useRightControl) shorten = 20; $("#ikMapTopPanel").css({width: ($("#"+this.settings.containerId).width()-shorten)+"px", left: "10px"}); $("#ikLPGrey").css({top: "0px"}); $("#ikLeftPanel>.sticky-close").hide(); } if(this.settings.leftControl == V_HIDDEN || this.settings.mobile) { var tabZ = parseInt($("#ikLeftPanel").css("z-index")); $("#ikLeftPanel").css({"z-index": ""+(tabZ+1)}); $("#ikRightPanel").css({"z-index": ""+(tabZ-1)}); this.toggleTrgtTree(); } //Osoittimen koordinaattien uudelleensijoitus ruudulla $("div.olControlMousePosition").css({"z-index": "99999", left: ($("#"+this.settings.containerId).width()/2+TrgtTreeWidth/2-107-RightPanelWidth/2)+"px"}); //Työkalupainikkeiden bindaukset: $(".ikMeasureToggle").click(function() { var buttonId = $(this).attr("id"); var setOn = true; if($("."+buttonId).siblings(".ikMeasureToggle").hasClass("ikSelectedTool")) { $("."+buttonId).siblings(".ikMeasureToggle",".ikSelectedTool").each(function() { $(this).trigger("click"); }); } if($("."+buttonId).hasClass("ikSelectedTool")) { setOn = false; $("."+buttonId).removeClass("ikSelectedTool"); } else { $("."+buttonId).addClass("ikSelectedTool"); } if(buttonId == "ikMarkControl") { guiObj.infokOlMap.setMarkingControl(setOn); if(guiObj.setRoutes.length > 0 && !setOn) { guiObj.showRouteMeasureTool(true); } guiObj.showCoordTool(setOn); } else { guiObj.infokOlMap.setMeasuringControl(setOn, $(".ikMeasTypeSelect:checked").val()); if(guiObj.setRoutes.length > 0 && !setOn) { guiObj.showRouteMeasureTool(true); } else { guiObj.showMeasureTool(setOn); } } }); $(".ikDimToggle").click(function() { var buttonId = $(this).attr("id"); var opac = 1.0; if($("."+buttonId).hasClass("ikSelectedDimTool")) { $("."+buttonId).removeClass("ikSelectedDimTool"); } else { opac = 0.4; $("."+buttonId).addClass("ikSelectedDimTool"); } guiObj.infokOlMap.dimBaseLayer(opac); }); $(".ikPrintToggle").click(function() { var buttonId = $(this).attr("id"); if(!$("."+buttonId).hasClass("ikSelectedTool")) { $("."+buttonId).addClass("ikSelectedTool"); guiObj.showPrintTool(true); } else { $("."+buttonId).removeClass("ikSelectedTool"); guiObj.showPrintTool(false); } }); $(".ikLinkToggle").click(function() { var buttonId = $(this).attr("id"); if(!$("."+buttonId).hasClass("ikSelectedTool")) { $(this).siblings(".ikSelectedTool:not(#ikHelpControl)").trigger("click"); $("."+buttonId).addClass("ikSelectedTool"); if(!guiObj.settings.mobile) { var content = "
Karttalinkki"; content += "

Karttalinkki kohdistuu ruudulla näkyvään tilaan. Linkkiin tallentuu valittu kartta, kohteet, reitit ja alueet infoteksteineen.

"; content += "

Lisää oman kohteen sijainti karttalle. Voit lisätä kohteelle haluamasi viestin.


"; content += ""; content += "
"; content += "
"; content += "

"; content += "

"; content += " "; content += "

Kopioi alla oleva internetosoite linkiksi.

"; content += "

"; content += "
"; content += ""; content += ""; content += "


"; guiObj.createLeftOverPanel(content, function() { $(".ikLopCont").unbind('.scrollbarPaper'); $(".ikLopCont").removeData('scrollbarPaper'); $(".ikLopCont").siblings(".scrollbarpaper-container").remove(); guiObj.infokOlMap.removePointControl(); $("#ikSaveLinkPop").remove(); $("#ikLinkControl").removeClass("ikSelectedTool"); guiObj.showSavedLinks(false); return true; }); $(".ikLinkTxt").css({width: (RightPanelWidth-50)+"px"});//, border: "1px solid green", cursor: "text"}); $("#ikLinkPointDeact").hide(); $("#ikLinkTextCont").hide(); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[map_link.']").localize("linklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } guiObj.showSavedLinks(true); $("#ikLinkPointAct").bind("click", function() { guiObj.infokOlMap.createPointControl(); $(".ikLinkPointToggle").toggle(); $("#ikLinkTextCont").slideToggle(); }); $("#ikLinkPointDeact").bind("click", function() { guiObj.infokOlMap.removePointControl(); $(".ikLinkPointToggle").toggle(); $("#ikLinkTextCont").slideToggle(); $("#ikMapLink").html(""); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); }); $("#ikLinkText").bind("keyup", function() { $("#ikMapLink").html(""); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); }); $("#linkSubmit").bind("click", function() { guiObj.loadTinyUrl(); $(".ikLinkResults").show(); }); $("#ikSaveLinkButton").click(function() { guiObj.loadTinyUrl(true); }); $("#ikLinkPreview").bind("mousedown", function() { var link = $("#ikMapLink").text(); $(this).parents("form").find("[placeholder]").each(function() { var input = $(this); if (input.val() == input.attr("placeholder")) { input.val("''"); } }); $("#hidTinyUrl").val(link.substr(link.indexOf("=")+1)); if(link.length > 0)$(this).parents("form:first").attr("action", link); }); } else { guiObj.loadTinyUrl(true); guiObj.showSavedLinks(true); } } else { $(".ikLopCont").unbind('.scrollbarPaper'); $(".ikLopCont").removeData('scrollbarPaper'); $(".ikLopCont").siblings(".scrollbarpaper-container").remove(); guiObj.infokOlMap.removePointControl(); $("#ikSaveLinkPop").remove(); $("."+buttonId).removeClass("ikSelectedTool"); $("#ikLinkOptCont").remove(); guiObj.showSavedLinks(false); } }); $(".ikFeedbackToggle").click(function() { var buttonId = $(this).attr("id"); if(!$("."+buttonId).hasClass("ikSelectedTool")) { $(this).siblings(".ikSelectedTool").trigger("click"); $("."+buttonId).addClass("ikSelectedTool"); var content = "
Palautelomake"; content += "

Ole hyvä ja anna palautetta joko kartan toimivuudesta tai sen sisällöstä. Erityisen mielellämme kuulemme puuttuvista kohteista tai vanhentuneista tiedoista, jotta voimme korjata virheet. Tarvittaessa voit tehdä karttalinkin (lisää oma kohde) kohteen sijainnista.


"; content += ""; content += "
"; content += "


"; content += "

"; content += "
"; content += "
Palautteen vastaanottaja:
"; content += "
"; content += "

"; content += "
"; content += "Kiitoksia palautteesta."; content += "Lähetys epäonnistui."; content += "

"; guiObj.createLeftOverPanel(content, function() { $(".ikLopCont").unbind('.scrollbarPaper'); $(".ikLopCont").removeData('scrollbarPaper'); $(".ikLopCont").siblings(".scrollbarpaper-container").remove(); guiObj.infokOlMap.removePointControl(); $("#ikFeedbackControl").removeClass("ikSelectedTool"); return true; }); $(".ikFeedbackTxt").css({width: (RightPanelWidth-50)+"px"});//border: "1px solid green", , cursor: "text"}); $("#ikFeedbackPointDeact").hide(); $(".ikFeedbackResults").hide(); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[feedback.']").localize("feedbacklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $("#ikFeedbackPointAct").bind("click", function() { guiObj.infokOlMap.createPointControl(); $(".ikFeedbackPointToggle").toggle(); }); $("#ikFeedbackPointDeact").bind("click", function() { guiObj.infokOlMap.removePointControl(); $(".ikFeedbackPointToggle").toggle(); }); $("#ikFeedbackText").keyup(function() { $("#feedbackSubmit").show(); $("#ikFeedback_fail").hide(); $("#ikFeedback_success").hide(); }); $("#feedbackSubmit").bind("click", function() { guiObj.submitFeedback(); }); } else { $(".ikLopCont").unbind('.scrollbarPaper'); $(".ikLopCont").removeData('scrollbarPaper'); $(".ikLopCont").siblings(".scrollbarpaper-container").remove(); guiObj.infokOlMap.removePointControl(); $("."+buttonId).removeClass("ikSelectedTool"); $("#ikFeedbackOptCont").remove(); } }); $(".ikLanToggle").click(function() { var buttonId = $(this).attr("id"); if($("."+buttonId).hasClass("ikSelectedTool")) { $("."+buttonId).removeClass("ikSelectedTool"); $("#ikLanSelCont").animate({height: "0px"}, { duration: "normal", complete: function() { $("#ikLanSelCont").remove(); } }); } else { $("."+buttonId).addClass("ikSelectedTool"); var guiPos = $("#"+guiObj.settings.containerId).position(); var pos = $("."+buttonId).position(); var languages = ""; if(guiObj.settings.langs && guiObj.settings.langs.length > 0) { $(guiObj.settings.langs).each(function(num) { languages += "

"; }); $("
"+languages+"
").appendTo("."+buttonId).sticky( { draggable: false, top: ($("."+buttonId).outerHeight()+9)+"px", left: "0px", height: "0px", width: "30px", background: "white", border: "none", fade: "false", fade_opacity: "1.0", onclose: function() { return false;} }); $("#ikLanSelCont").animate({height: (guiObj.settings.langs.length*20)+"px"}); $(".ikLan").click(function() { var lanId = $(this).attr("id"); var selection = lanId.substr(lanId.indexOf("_")+1); $("#ikLanSelect").removeClass("ikSellan_"+ikLan); $("#ikLanSelect").addClass("ikSellan_"+selection); guiObj.changeLanguage(selection); }); } } }); //Jos karttalinkin ikHash: if(ikHash) { this.selCounty = ikHash.selCounty; this.selTheme = ikHash.selTheme; guiObj.isLoadingHash = true; guiObj.selectedSearch = ikHash.oidsOnMap; guiObj.hashGroups = ikHash.openGroups; } this.loadCounties(); this.loadThemes(); this.loadTargets(null); this.createRightPanel(); if(!this.settings.useRightControl) { RightPanelWidth = 0; var shorten = 10; if(this.settings.leftControl == V_OFF) shorten = 20; $("#ikMapTopPanel").css({width: ($("#"+this.settings.containerId).width()-shorten)+"px", right: "10px"}); $("#ikRPGrey").css({top: "0px"}); $("#ikRightPanel>.sticky-close").hide(); } else { this.updateSaveLinkList(); } if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } //Helpin lisäys: if(this.settings.showHelp != V_OFF && !this.settings.mobile) { //Väliaikainen(?) siirto
$("#ikMiniContPanel").css({width: ($("#ikMiniContPanel").width() + 32)+"px"}); $("#ikMCLeft").css({width: ($("#ikMCLeft").width() + 32)+"px"}); $("
").appendTo("#ikMCLeft") .css({left: (toolArray.length*32+12)+"px"}); //************* $("#ikHelpControl").click(function() { var buttonId = $(this).attr("id"); if(!$("."+buttonId).hasClass("ikSelectedTool") || guiObj.welcomeVisible) { $("."+buttonId).addClass("ikSelectedTool"); if($(".ikHelpBody").html().length == 0 || guiObj.welcomeVisible) { guiObj.welcomeVisible = false; guiObj.loadHelp(); } else { guiObj.showHelpPanel(true); } } else { $("."+buttonId).removeClass("ikSelectedTool"); guiObj.showHelpPanel(false); if($(".ikRpCont").length <= 1) { } } }); if(this.settings.showHelp == V_SHOWN && (!ikHash || (!ikHash.usrMessage && !ikHash.infoPanel))) $("#ikHelpControl").trigger("click"); } //Linkkinapin lisäys (upotetussa kartassa): if(this.settings.buttonLinkUrl) { $("
").appendTo("#"+this.settings.containerId).sticky( { draggable: false, bottom: "20px", right: "20px", height: "35px", width: "36px", background: "transparent", fade: "false", fade_opacity: "1.0", onclose: function() { return false;} }); $("#ikLinkButtonCont .sticky-close").hide(); } //Palikat saadaan asettumaan paikoilleen, kutsumalla onWindowResize this.onWindowResize(); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("searchlan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } //Loput karttalinkin latailut: if(ikHash) { if(ikHash.selMap)this.selectMap(ikHash.selMap, true); this.infokOlMap.map.moveTo(new OpenLayers.LonLat(ikHash.mapCenter[0], ikHash.mapCenter[1]) , ikHash.mapZoom); if(ikHash.usrPoint) { this.uPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ikHash.usrPoint[0], ikHash.usrPoint[1]), {iksymbol: "RedBall18.gif", "ikdescription-fi": "Linkitetty kohde", "ikdescription-en": "Linked target", objectid: "usrTrgt_1", partid: "usrTrgt_1"}); this.uPoint.fid = "usrTrgt_1"; this.infokOlMap.usrLayer.addFeatures([this.uPoint]); this.infokOlMap.ikTrgtCtrl.select(this.uPoint); this.showUsrTrgtMessage(); } else if(ikHash.infoPanel){ this.loadTrgtInfo(ikHash.infoPanel[0], ikHash.infoPanel[1]); } var oids = []; for(var oid in ikHash.oidsOnMap) { oids.push(""+oid); } var pids = ikHash.pidsOnMap; var oids_n_pids = [oids, pids]; this.mapInitCounter = 201; this.mapInitTimerId = window.setTimeout( OpenLayers.Function.bind(this.addHashSelection, this, oids_n_pids), 500 ); } //Tällä saadaan placeholderit näkymään kentissä myös "huonomilla selaimilla" $(".ikField").trigger("blur"); if(this.infokOlMap.map.baseLayer.CLASS_NAME != "OpenLayers.Layer.Google") { $(".olLayerGooglePoweredBy").hide(); } } }; /**************************************************************** Lisätään linkitetyt kohteet kartalle viiveellä, että OpenLayers on alustettu. Jos ei, odotetaan lisää ****************************************************************/ function AddHashSelection(oids_pids) { if(this.infokOlMap.initialized) { if(this.mapInitTimerId != null) { window.clearTimeout(this.mapInitTimerId); this.mapInitTimerId = null; } var guiObj = this; if(ikHash.overlays && ikHash.overlays.length > 0) { $(ikHash.overlays).each(function() { guiObj.infokOlMap.setOverlay(""+this, true) }); } this.showRouteMeasureTool(ikHash.showRouteMeasure); if(ikHash.actRouteMeasure)this.infokOlMap.toggleRouteMeasure(); if(oids_pids[0].length > 0)this.infokOlMap.addFeatures(oids_pids[0]); if(oids_pids[1].length > 0)this.infokOlMap.addParts(oids_pids[1]); this.infokOlMap.selTrgts(ikHash.selOids); this.infokOlMap.selPids(ikHash.selParts); if(ikHash.actRouteMeasure)this.infokOlMap.measureRoutes(); } else if(this.mapInitCounter > 0) { this.mapInitCounter--; this.mapInitTimerId = window.setTimeout( OpenLayers.Function.bind(this.addHashSelection, this, oids_pids), 300 ); } }; /**************************************************************** Luodaan linkin json-string. createFeedBack: (boolean) poimitaanko mukaan palautelomakkeen kentät ****************************************************************/ function CreateHashLink(createFeedback) { var oidsArray = []; var guiObj = this; $(this.infokOlMap.trgtsOnMap).each(function() { var insearch = $.isEmptyObject( guiObj.selectedSearch )? null:guiObj.selectedSearch[""+this]; if(insearch) { oidsArray[""+this] = insearch; } else { var tmpArr = []; $("."+this, "#ikTTCont").parents(".ttRow").each(function() { tmpArr.push($(this).attr("id")); }); if(tmpArr.length > 0)oidsArray[""+this] = tmpArr; } }); var treeQue = []; $(".ttRowBody:visible", "#ikTTCont").each(function() { treeQue.push($(this).parents(".ttRow:first").attr("id")); }); var treeStr = treeQue.length > 0? "['"+treeQue.join("','")+"'],": "[],"; var tmpCent = this.infokOlMap.getIkMapCenter(); var usrPoint = (this.infokOlMap.pointCtrl && this.infokOlMap.pointCtrl.lastPoint)? this.infokOlMap.pointCtrl.lastPoint.geometry : null; var jsonStr = "{"; jsonStr += "'lan':'"+ikLan+"','clientId':'"+ikClient+"',"; jsonStr += "'openGroups': "+treeStr; jsonStr += "'mapCenter': ["+tmpCent.lon+","+tmpCent.lat+"],"; jsonStr += "'mapZoom':"+ this.infokOlMap.map.getZoom()+","; jsonStr += "'selMap':'"+ this.infokOlMap.getBaseLayerName()+"',"; if(this.infokOlMap.selectedOverlays.length > 0) { jsonStr += "'overlays': ['"+this.infokOlMap.selectedOverlays.join("','")+"'],"; } else { jsonStr += "'overlays': [],"; } jsonStr += "'mapProj':'"+ this.infokOlMap.map.getProjection()+"',"; jsonStr += "'oidsOnMap':{"; for(var oid in oidsArray) { var tmpArr = $.map(oidsArray[oid], function(o) {return "'"+o+"'";}); jsonStr += "'"+oid+"':["+tmpArr+"],"; } if(jsonStr.lastIndexOf(",") == jsonStr.length - 1) jsonStr = jsonStr.slice(0, jsonStr.length - 1); jsonStr += "},"; if(this.infokOlMap.selectedTrgts.length > 0) { jsonStr += "'selOids': ['"+this.infokOlMap.selectedTrgts.join("','")+"'],"; } else { jsonStr += "'selOids': [],"; } if(this.infokOlMap.partsOnMap.length > 0) { jsonStr += "'pidsOnMap': ['"+this.infokOlMap.partsOnMap.join("','")+"'],"; } else { jsonStr += "'pidsOnMap': [],"; } if(this.infokOlMap.selectedParts.length > 0) { var partStr = "'selParts': ["; for(var pid in this.infokOlMap.selectedParts) { if($.isArray(this.infokOlMap.selectedParts[pid])) { partStr += "['"+this.infokOlMap.selectedParts[pid].join("','")+"'],"; } else { partStr += "'"+this.infokOlMap.selectedParts[pid]+"',"; } }//fix the ending.. jsonStr += partStr.substring(0,partStr.length - 1)+"],"; } else { jsonStr += "'selParts': [],"; } if(createFeedback) { var feedB = $("#ikFeedbackText").val().replace(/\n/g, "
"); feedB = feedB.replace(/\t/g, " "); feedB = feedB.replace(/\r\n/g, "
"); feedB = feedB.replace(/\r/g, "
"); jsonStr += "'feedback': '"+feedB; //jsonStr += "'feedback':'"+$("#ikFeedbackText").val(); jsonStr += "','name':'"+$("#ikFeedBack_name").val(); jsonStr += "','email':'"+$("#ikFeedBack_email").val(); jsonStr += "','to':'"+$(".ikFeedBack_receiver:checked").val()+"',"; } if(usrPoint != null) { jsonStr += "'usrPoint': ["+usrPoint.x+","+usrPoint.y+"],"; if(!createFeedback) { if($("#ikLinkText").val().length > 0) { var message = $("#ikLinkText").val().replace(/\n/g, "
"); message = message.replace(/\t/g, " "); message = message.replace(/\r\n/g, "
"); message = message.replace(/\r/g, "
"); jsonStr += "'usrMessage': '"+message+"',"; } } } else if($("#ikInfoCont:visible") && $(".ikInfoBody").html().length > 0) { jsonStr += "'infoPanel': ['"+$("#ikInfoCont").data("trgtid")+"','"+$("#ikInfoCont").data("infoid")+"'],"; } else if($("#"+this.settings.altInfoPanel)) { jsonStr += "'infoPanel': ["+$("#"+this.settings.altInfoPanel).data("trgtid")+","+$("#"+this.settings.altInfoPanel).data("infoid")+"],"; } jsonStr += "'selCounty':'"+ ($(".selCounty").data("countyval")||"")+"',"; jsonStr += "'selTheme':'"+ ($(".selTheme").data("themeval")||"")+"',"; var sroute = this.infokOlMap.rMeasCreated?true:false; jsonStr += "'showRouteMeasure':"+sroute+","; var aroute = this.infokOlMap.rMeasActive?true:false; jsonStr += "'actRouteMeasure':"+aroute jsonStr += "}"; return jsonStr; }; /**************************************************************** Vasemman paneelin luonti createHidden: (boolean)- luodaanko suoraan piilotettu paneeli ****************************************************************/ function CreateLeftPanel(createHidden) { var guiObj = this; var panelWidth = createHidden? 0:TrgtTreeWidth; //Tähän kaiken kiinteän sisällön ymppäys vasemman laidan kontrolliin var mapSelHtml = ""; if(this.settings.showMapSelection && !$.isEmptyObject( ikMaps )) { var mapButtons = ""; var firstName = null; var firstMn = null; for(var mn in ikMaps) { var map = ikMaps[mn]; if(map.mVisibility) { var name = map["mName-"+ikLan] || mn; if(!firstName) firstName = name; if(!firstMn) firstMn = mn; mapButtons += "
"+name+"
"; } } var initOpac = ikMaps[firstMn].mLayer.opacity || 100; mapSelHtml += "
"; mapSelHtml += "
"+firstName+"
"+mapButtons;+"
"; mapSelHtml += "
"; } var searchHtml = ""; searchHtml += "
" +"
Haku" +"
"; /*Custom-haun demo & template: if(ikClient&& ikClient.indexOf("polarmit") != -1) { searchHtml +="
" +"
Laajennettu haku >>
" +"
" +"
" +"
Ryhmät" +"
" +"
" +"
" +"
" +"

" +"Mittarityyppi: " +"

" +"Hae kuulumattomat aikaväliltä:
" +"
" +"-" +"

" +"
" +"
Hae master-mittarit, joilla yli slave-yhteyttä.

" +"" +"
" +"
"; } */ searchHtml += "

Ei hakutuloksia

"; var cNtSelHtml = ""; if(this.settings.showCountySelect || this.settings.showThemeSelect) { cNtSelHtml += "
"; if(this.settings.showCountySelect) cNtSelHtml += "
Rajaa kohteita:
"; if(this.settings.showThemeSelect) cNtSelHtml += "
Rajaa kohteita:
"; cNtSelHtml += "
"; } var usrTrgts = (ikHash && ikHash.usrPoint)? "
" +"
" +"
" +"
Linkitetty kohde
":""; //Ympätään vasemman panelin sisältö kehykseen: $("
"+mapSelHtml+searchHtml+"
"+cNtSelHtml+usrTrgts+"
") .appendTo("#"+this.settings.containerId) .sticky({ draggable: false, top: "0px", height: $("#"+this.settings.containerId).height()+"px", backgroundColor: "white", fade: "false", fade_opacity: "1.0", width: panelWidth+"px", left: "0px", onclose: function() { guiObj.toggleTrgtTree(); return false; } }); if(!this.settings.showTrgtTree) $("#ikAllTrgtCont").hide(); if(!this.settings.showSearch)$("#ikSearchCont").hide(); this.setZoomBarPos(); var csH = 0; $("#ikCustomSearchBody").children().each(function() { csH += $(this).height(); }); if(csH > $(".ikMapGuiContainer").innerHeight()- 200) { csH = $(".ikMapGuiContainer").innerHeight()- 200; $("#ikCustomSearchBody").css({height: csH+"px", overflow: "auto", "margin-right": "-5px"}); if(guiObj.settings.oldMobile) { $("#ikCustomSearchBody").buttonscroller(); } else { try{$("#ikCustomSearchBody").scrollbarPaper();}catch(e){} } } $("#ikCustomSearchBody").data("height-data", $("#ikCustomSearchBody").height()); $("#ikCustomSearchBody").hide(); try { var datePickLocal = ikLan == "en"? "":ikLan; $.datepicker.setDefaults( $.datepicker.regional[ datePickLocal ] ); $( ".ikDateFrom" ).each(function() {$(this).datepicker({ defaultDate: null, dateFormat: "dd-mm-yy", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $(this).siblings( ".ikDateTo" ).datepicker( "option", "minDate", selectedDate ); } });}); $( ".ikDateTo" ).each(function() {$(this).datepicker({ defaultDate: null, dateFormat: "dd-mm-yy", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $(this).siblings( ".ikDateFrom" ).datepicker( "option", "maxDate", selectedDate ); } });;}); } catch(e){} var opacVal = ikMaps[firstMn].mLayer.opacity || 100; $("#mapOpacSlider").slider({ value: opacVal, create: function(event, ui) { var val = opacVal; $("#ikMapOpacVal").html(val+" %"); guiObj.infokOlMap.dimBaseLayer(val / 100.0); }, slide: function(event, ui) { var val = ui.value; $("#ikMapOpacVal").html(val+" %"); guiObj.infokOlMap.dimBaseLayer(val / 100.0); } }); $("#ikSelMapOpacity").click(function(){return false;}); $(".ikMapRow:first").addClass("selMap"); $(".ikMapRow:first>.ikMapSelect").addClass("ikMapSelect_active"); var mButtons = $(".ikMapRow"); if(mButtons.length > 3) { $(mButtons).slice(2).hide(); $("#ikMapSelBody").append("
Näytä lisää karttoja
Näytä vähemmän
"); $("#ikLessMaps").hide(); $(".ikToggleMapListButton").click(function() { $(".ikToggleMapListButton").toggle(); $("#ikMapSelBody>.ikMapRow").slice(2).toggle(); $("#ikMapSelCont").animate({height: $("#ikMapSelBody").height()+"px"}, {duration: "fast"}); }); } $(mButtons).bind("click", function() { if(!$(this).hasClass("selMap")) { var mName = ""+$(this).data("mname"); guiObj.selectMap(mName); } }); $("#ikSearchCont").css({height: ($("#ikSearchTitle").outerHeight()+$("#ikSearchBottomSpacer").outerHeight())+"px"}); $(".ikSearchClosed").css({cursor: "pointer"}); $("#ikSearchResultCont").hide(); $("#ikClearSearch").hide(); $("#ikSearchBottomToggle").hide(); $("#ikSearchResultCont").css({top: ($("#ikSearchTitle").height()+10)+"px"}); /*************************************************************************************** * Binding events for search: ***************************************************************************************/ $("#ikCustomSearchTitle").click(function() { if($("#ikCustomSearchBody:visible").length > 0) { $("#ikSearchResultCont").animate({top: ($("#ikSearchTitle").height()-$("#ikCustomSearchBody").data("height-data")+10)+"px"}); $("#ikCustomSearchBody").slideUp(); $("#ikSBDiv").slideDown(); $(".ikCustomSearchClosed").removeClass("ikCustomSearchOpen"); } else { $("#ikSearchResultCont").animate({top: ($("#ikSearchTitle").height()+$("#ikCustomSearchBody").data("height-data")+10)+"px"}); $("#ikCustomSearchBody").slideDown("normal", function() { guiObj.onWindowResize(); }); $("#ikSBDiv").slideUp(); $(".ikSearchClosed").addClass("ikSearchOpen");//$("#ikCustomSearchBody"). guiObj.adjustSearchCont("show"); $(".ikCustomSearchClosed").addClass("ikCustomSearchOpen"); } if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikAllTrgtCont").buttonscroller(); $("#ikSearchResultCont").buttonscroller(); } else { try{$("#ikAllTrgtCont").scrollbarPaper();}catch(e){} try{$("#ikSearchResultCont").scrollbarPaper();}catch(e){} } }); $("#ikCustomSearchForm").change(function() { guiObj.customSearchTargetCount($("#ikCustomSearchForm").serialize()); }); $("#ikCustomSearchButton").click(function() { $("#ikSearchResultCont").html(""); $("#ikCustomSearchBody").slideToggle("normal", function() { $(".ikCustomSearchClosed").removeClass("ikCustomSearchOpen"); $("#ikSearchResultCont").css({top: ($("#ikSearchTitle").height()+10)+"px"}); }); $("#ikSearchBar").val(""); $("#ikClearSearch").hide(); $("#ikNoSearchResult").hide(); guiObj.loadSearchTargets($("#ikCustomSearchForm").serialize(), false, true); return false; }); $(".ikSearchClosed").bind("click", function() { if($(this).hasClass("ikSearchOpen")) { if($("#ikCustomSearchBody:visible").length > 0) { $("#ikCustomSearchBody").hide(); $(".ikCustomSearchClosed").removeClass("ikCustomSearchOpen"); $("#ikSearchResultCont").animate({top: ($("#ikSearchTitle").height()+10)+"px"}); $("#ikSBDiv").slideDown(); } guiObj.adjustSearchCont("hide"); $(this).removeClass("ikSearchOpen"); } else { guiObj.adjustSearchCont("show"); $(this).addClass("ikSearchOpen"); } }); $("#ikSearchBottomToggle").click(function() {$(".ikSearchClosed").click();}); $("#ikSearchLabel").click(function(){$(this).siblings(".ikSearchClosed").trigger("click");}); $("#ikSearchBar").bind("keyup", function() { if($(this).val().length == 0) { $("#ikClearSearch").hide(); guiObj.adjustSearchCont("hide"); } else if(!guiObj.settings.oldMobile) { $("#ikClearSearch").show(); } if($(this).val().length >= 3) { var word = $(this).val().slice(0); var incGroups = $("#ikShowGroupsInSearch:checked").length > 0? true:false; guiObj.loadSearchTargets(word, false); } else { $("#ikSearchResultCont").html(""); $("#ikSearchResultCont").slideUp(); $("#ikNoSearchResult").show();//hide(); $(".ikSearchClosed").removeClass("ikSearchOpen"); } }); $("#ikClearSearch").click(function() { for(var oid in guiObj.addrsOnMap) { guiObj.infokOlMap.selectedTrgts = separateArray([oid], guiObj.infokOlMap.selectedTrgts); guiObj.infokOlMap.selectedParts = separateArray([oid], guiObj.infokOlMap.selectedParts); try { guiObj.infokOlMap.usrLayer.removeFeatures([guiObj.addrsOnMap[oid]]); delete guiObj.addrsOnMap[oid]; } catch(e) {} } if(guiObj.infokOlMap.partsOnMap.length > 0) { guiObj.infokOlMap.remParts(guiObj.infokOlMap.partsOnMap); } $("#ikSearchBar").val(""); $("#ikSearchBar").trigger("keyup"); $("#ikSearchBar").trigger("blur"); return false; }); $("#ikSearchLimToView").change(function() { $("#ikSearchBar").trigger("keyup"); return false; }); $(".ikCnBBody", ".ikMapGuiContainer").hide(); $(".ikCnTTitle").bind("click", function() { if($(this).children(".ikCoTClosed").hasClass("ikCoTOpen")) { $(this).siblings(".ikCnBBody").slideUp(); $(this).children(".ikCoTClosed").removeClass("ikCoTOpen"); $(this).children(".ikGroupOnList").removeClass("ikOpenGroupTitle"); } else { $(".ikCnBBody").slideUp(); $(this).siblings(".ikCnBBody").slideDown(); $(".ikCoTOpen").removeClass("ikCoTOpen"); $(this).children(".ikCoTClosed").addClass("ikCoTOpen"); $(".ikGroupOnList").removeClass("ikOpenGroupTitle"); $(this).children(".ikGroupOnList").addClass("ikOpenGroupTitle"); } }); $(".usrTRowTitle").bind("click", function() { guiObj.selectUsrTarget(this); return false; }); $(".ikUsrTrgt_select").bind("click", function() { guiObj.checkUsrTarget(this); return false; }); $("#ikAllTrgtCont").css({height: ($("#"+guiObj.settings.containerId).innerHeight()-$("#ikMapSelCont").outerHeight()-$("#ikSearchTitle").outerHeight()-$("#ikSearchBottomSpacer").outerHeight()-$("#ikAllTrgtBottomSpacer:visible").outerHeight()-11)+"px"}); $(".olControlScaleLine").css({left: (panelWidth+70) +"px"}); $(".olLayerGooglePoweredBy").css({left: (panelWidth+5) +"px"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").css({left: (panelWidth+5) +"px"}); }; /**************************************************************** Oikean paneelin luonti ****************************************************************/ function CreateRightPanel() { var guiObj = this; var html = "
" +"
" +"Tallennetut linkit" +"
" +"
" +"Tulostus" +"

"// +"
Paperin koko:
" +"" +"
" +"
Tulostussuunta:
" +"" +"
" +"
Tulostustapa:
" +"" // 11.2.2014 // +"
" +"
" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"
" +"
" +"
" +"
" +"Mittaa kartaltaMittaa reittiä" +"

" +"" +"" +"
" +"
0 m
" +"

" +"
"; html += "Merkitse koordinaatit"; html += "

"; html += "


"; html += ""; html += "

" html += "
"; var options = ""; var forms = ""; for(var title in this.settings.coordTool.selection) { var cObj = this.settings.coordTool.selection[title]; options += ""; forms += "
P(N)m
I(E) m
"; } if(this.settings.coordTool.showWGS84) { options += ""; forms += "
N/P/lat°
E/I/lon°
"; forms += "
N/P/lat°
E/I/lon°
"; forms += "
N/P/lat°
E/I/lon°
"; forms += "
N/P/lat°
E/I/lon°
"; } html += "Koordinaatisto

"; html += forms+"
"; html += "

"; html += "
> Pysäytä
> Kumoa viimeinen piste
> Uusi mittaus
Vinkki!

Voit valita reittiä etapeittain. Reittien yhteenlasketun pituuden näet yllä olevassa kentässä.

" +"
Ohje
Ajankohtaista
" +"
Kohteen lisätiedot
" +"
Kohteen lisätiedot

Ei esitettäviä lisätietoja.
" +"
"; $(html).appendTo("#"+this.settings.containerId).sticky({draggable: false, top: "0px", height: $("#"+guiObj.settings.containerId).height()+"px",//bottom: "0px",height: "100px", backgroundColor: "white", fade: "false", fade_opacity: "1.0", width: "0px", right:"0px",//left: (TrgtTreeWidth+200)+"px", onclose: function() {guiObj.toggleRightPanel(); return false;} }); $("#ikWelcomeTitle").hide(); $(".ikRpElems").hide(); $("#ikMeasTip").hide(); $("#ikRestartMPButton").hide(); $("#ikRouteMTitle").hide(); $("#ikRightPanel>.sticky-close").addClass("ikRPClosedHandle"); if(guiObj.settings.mobile) { guiObj.showNoInfoPanel(true); } $("#ikSLinkCont>.ikCloseCont").click(function() { guiObj.showSavedLinks(false); }); $("#ikPrintToolCont>.ikCloseCont").click(function() { $(".ikPrintToggle").trigger("click"); }); $(".ikCloseMeasure").click(function() { if($(".ikRMeasToggleButton:visible").length > 0) { guiObj.showRouteMeasureTool(false); } else { $("#ikPathMeasureControl").trigger("click"); } }); $("#ikMeasTip>.ikCloseCont").click(function() { $("#ikMeasTip").hide(); guiObj.adjustRPLowerPanels(); }); $(".ikCloseCTool").click(function() { $("#ikMarkControl").trigger("click"); }); $("#ikInfoCont>.ikCloseCont").click(function() { if(guiObj.settings.mobile && (!guiObj.infokOlMap.rMeasCreated || !guiObj.infokOlMap.rMeasActive)) { guiObj.infokOlMap.selectedParts = []; guiObj.infokOlMap.selectedTrgts = []; guiObj.infokOlMap.selAreaWMS.mergeNewParams({"viewParams":""}); guiObj.infokOlMap.selRouteWMS.mergeNewParams({"viewParams":""}); guiObj.infokOlMap.selPointWMS.mergeNewParams({"viewParams":""}); guiObj.infokOlMap.selAreaWMS.setVisibility(false); guiObj.infokOlMap.selRouteWMS.setVisibility(false); guiObj.infokOlMap.selPointWMS.setVisibility(false); $(".ikSelectedOnList").removeClass("ikSelectedOnList"); $("#"+$("#ikInfoCont").data("trgtid")+">.ttRowTitle>.ikTrgtName").removeClass("ikSelectedOnList"); $("#"+$("#ikInfoCont").data("trgtid")+">.usrTRowTitle>.ikUsrTrgtName").removeClass("ikSelectedOnList"); $("#"+$("#ikInfoCont").data("trgtid")+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); guiObj.infokOlMap.ikTrgtCtrl.unselectAll(); } guiObj.showInfoPanel(false); }); $("#ikHelpCont>.ikCloseCont").click(function() { guiObj.showHelpPanel(false); $("#ikHelpControl").removeClass("ikSelectedTool"); }); $("#ikScalePrintSelect").hide() $("#ikPrintForm").change(function() { guiObj.printFormChanged(); }); $("#printSubmit").bind("mousedown", function() { $(this).parents("form").find("[placeholder]").each(function() { var input = $(this); if (input.val() == input.attr("placeholder")) { input.val("''"); } }); var lpW = guiObj.getLeftPanelVisibleWidth(); var rpW = guiObj.getRightPanelVisibleWidth(); var cent = guiObj.infokOlMap.map.getCenter(); var curRes = guiObj.infokOlMap.map.getResolution(); cent = cent.add(lpW*curRes/2-rpW*curRes/2, 0); var zoom = guiObj.infokOlMap.map.getZoom(); if(guiObj.infokOlMap.map.baseLayer.swLayers && guiObj.infokOlMap.map.baseLayer.swLayers.length > 0) { $("#printSwLayer").val(guiObj.infokOlMap.map.baseLayer.swLayers[zoom]); } $("#printmCent").val(cent); $("#printlayer").val(guiObj.infokOlMap.map.baseLayer.name); $("#printoverlays").val("["+guiObj.infokOlMap.selectedOverlays.join(",")+"]"); $("#printzoom").val(zoom); var oids = guiObj.infokOlMap.trgtsOnMap; var pids = guiObj.infokOlMap.partsOnMap; var selOids = guiObj.infokOlMap.selectedTrgts; $("#printoids").val(oids); $("#printpids").val(pids); $("#printselOids").val(selOids); if(guiObj.infokOlMap.selectedParts.length > 0) { var partStr = ""; for(var pid in guiObj.infokOlMap.selectedParts) { if($.isArray(guiObj.infokOlMap.selectedParts[pid])) { partStr += "['"+guiObj.infokOlMap.selectedParts[pid].join("','")+"'],"; } else { partStr += "'"+guiObj.infokOlMap.selectedParts[pid]+"',"; } }//fix the ending.. $("#printselFids").val(partStr.substring(0,partStr.length - 1)); } else { $("#printselFids").val("[]"); } if(guiObj.infokOlMap.ikMeasureControl) { var verts = guiObj.infokOlMap.ikMeasureControl.handler.line.geometry.getVertices(); if(verts && verts.length > 0 && !guiObj.infokOlMap.ikMeasureControl.handler.onPause) verts.pop(); $("#printmeasPoints").val(verts); if(guiObj.infokOlMap.ikMeasureControl.measType == "mark") { $("#printmeasFormat1").val($(".ikCcSelect option:selected").text()); } } $("#printdim").val($("#mapOpacSlider").slider("value")/100.0); $(this).parent("form").submit(); return true; }); $("#ikRestartMPButton").click(function() { guiObj.infokOlMap.setMeasuringControl(false, $(".ikMeasTypeSelect:checked").val()); guiObj.infokOlMap.setMeasuringControl(true, $(".ikMeasTypeSelect:checked").val()); $("#ikMeasurement").html("0 m"); if($("#ikToggleMeasureButton").hasClass("onPause")) { $("#ikToggleMeasureButton").html("> Pysäytä"); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[meastool_buttons.']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } } }); $(".ikMeasTypeSelect").change(function() { $("#ikMeasurement").html("0m"); guiObj.infokOlMap.setMeasuringControl(false, $(".ikMeasTypeSelect:checked").siblings(".ikMeasTypeSelect").val()); guiObj.infokOlMap.setMeasuringControl(true, $(".ikMeasTypeSelect:checked").val()); }); $(".ikCcSelect").focus(function() { if($(".changedForm").length > 0) { if(guiObj.updateCoordForms()) { $(".changedForm").removeClass("changedForm"); } } }); $(".ikCcSelect").change(function() { $(".ikCoordForms").hide(); $("#ik"+$(".ikCcSelect option:selected").val()).show(); }); var selectedCc; if(this.settings.coordTool && this.settings.coordTool.selected) { selectedCc = "ik"+this.settings.coordTool.selected; try{$("#ikCs"+this.settings.coordTool.selected).select();}catch(e){} } else { selectedCc = "ik"+$(".ikCcSelect>options:first").val(); try{$(".ikCcSelect>options:first").select();}catch(e){} } $(".ikCoordForms").hide(); $("#"+selectedCc).show(); $(".ikMarkToolTypeSelect").change(function() { guiObj.infokOlMap.ikMeasureControl.handler.layer.setVisibility(!guiObj.infokOlMap.ikMeasureControl.handler.layer.getVisibility()); guiObj.infokOlMap.ikMeasureControl.markLayer.setVisibility(!guiObj.infokOlMap.ikMeasureControl.markLayer.getVisibility()); }); $(".ikCoordForms").change(function() { $(this).addClass("changedForm"); }); var ttW = guiObj.getLeftPanelVisibleWidth(); $("#ikPrintCoordList").click(function() { var mapW = $("#"+guiObj.settings.containerId).width(); var mapH = $("#"+guiObj.settings.containerId).height(); var pPopW = 700; var pPopH = 500; var pPopT = mapH/2 - pPopH/2; var pPopL = mapW/2 - pPopW/2; if(mapH < pPopH) { pPopH = mapH; pPopT = 0; } if(mapW - ttW < pPopW) { pPopW = mapW; pPopL = 0; } var cObj = guiObj.settings.coordTool.selection[""+$(".ikCcSelect option:selected").val()]; var wgsFormat = $(".ikCcSelect option:selected").val(); var bHTML = "

Reittipisteiden koordinaatit:


"; bHTML += "
"+$(".ikCcSelect option:selected").text()+"
Välimatka/yhteensä

"; var nbr = 1; var prev = null; var total = 0; var urlParams = []; $(guiObj.infokOlMap.ikMeasureControl.marks).each(function() { var origLL = new OpenLayers.LonLat(this.x, this.y); if(guiObj.settings.coordListUrl) { if(guiObj.settings.coordListUrlProj)origLL.transform(guiObj.infokOlMap.map.getProjectionObject(), new OpenLayers.Projection(guiObj.settings.coordListUrlProj)); urlParams.push(origLL.lon.toFixed(1)+";"+origLL.lat.toFixed(1)); } else { var wgsCoords, cCoords; if(cObj) { var kkjLL = cObj.transTo(origLL, guiObj.infokOlMap.map.getProjection());//origLL.clone().transform(guiObj.infokOlMap.map.getProjectionObject(), new OpenLayers.Projection(kkjProj)); cCoords = "
"+kkjLL.lon.toFixed(cObj.decims)+" P(N)
"+kkjLL.lat.toFixed(cObj.decims)+" I(E)
"; } else { var wgsLL = origLL.clone().transform(guiObj.infokOlMap.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326")); if(wgsFormat == "AAAaaaa") { cCoords = "
N P/lat "+wgsLL.lat.toFixed(5)+"°
E I/lon "+wgsLL.lon.toFixed(5)+"°
"; } else { var tmpWgsObj = new wgs84Format(wgsLL); if(wgsFormat == "AMS") { cCoords = "
N P/lat "+tmpWgsObj.dms.lat[0]+"°"+tmpWgsObj.dms.lat[1]+""+tmpWgsObj.dms.lat[2].toFixed(3)+"
E I/lon "+tmpWgsObj.dms.lon[0]+"°"+tmpWgsObj.dms.lon[1]+""+tmpWgsObj.dms.lon[2].toFixed(3)+"
"; } else { var decims = 2; if(wgsFormat == "MMmmm") decims = 3; cCoords = "
N P/lat "+tmpWgsObj.dm.lat[0]+"°"+tmpWgsObj.dm.lat[1].toFixed(decims)+"
E I/lon "+tmpWgsObj.dm.lon[0]+"°"+tmpWgsObj.dm.lon[1].toFixed(decims)+"
"; } } } var measurements = "(+"; if(prev) { var length = guiObj.infokOlMap.ikMeasureControl.getLength(new OpenLayers.Geometry.LineString([prev, this]), "m"); total += length; measurements += length.toFixed(0)+"m / "+total.toFixed(0)+"m)" } else { measurements = "(-/-)"; } prev = this; bHTML += "
P"+nbr+"
"+cCoords+"
"+measurements+"
"; nbr++; } }); if(guiObj.settings.coordListUrl) { if(urlParams.length > 0) window.open(guiObj.settings.coordListUrl+urlParams.join(":"), "_blank", "width=700,height=400,left=200,top=100") } else { /* $("
"+bHTML+"
").appendTo("#"+guiObj.settings.containerId).sticky({ draggable: false, top: pPopT+"px", height: pPopH+"px", backgroundColor: "white", fade: "false", fade_opacity: "1.0", width: pPopW+"px", left: pPopL+"px", onclose: function() { return true;} }); */ guiObj.createPopPanel("ikMeasurePrintPop", bHTML, pPopW, pPopH); try { $("#ikMeasurePrintPop").find(".ikScroll").attr("id", "ikPrintPopCont"); if(!guiObj.settings.oldMobile) { $("#ikPrintPopCont").unbind('.scrollbarPaper'); $("#ikPrintPopCont").removeData('scrollbarPaper'); $("#ikPrintPopCont").siblings(".scrollbarpaper-container").remove(); $("#ikPrintPopCont").scrollbarPaper(); } else { $("#ikPrintPopCont").buttonscroller(); } }catch(err){} if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } } }); $(".ikShowCoordOnMap").click(function() { if(!guiObj.infokOlMap.ikMeasureControl.processing && guiObj.updateCoordForms()) { $(".changedForm").removeClass("changedForm"); guiObj.infokOlMap.ikMeasureControl.processing = true; var cObj = guiObj.settings.coordTool.selection[""+$(".ikCcSelect option:selected").val()]; var newLonLat; var llInProj; if(cObj) { newLonLat = cObj.get(); llInProj = cObj.proj; } else { newLonLat = new OpenLayers.LonLat(guiObj.infokOlMap.ikMeasureControl.wgsObj.d.lon, guiObj.infokOlMap.ikMeasureControl.wgsObj.d.lat); llInProj = "EPSG:4326"; } newLonLat.transform(new OpenLayers.Projection(llInProj), guiObj.infokOlMap.map.getProjectionObject()); var mch = guiObj.infokOlMap.ikMeasureControl.handler; var newPixel = mch.layer.getViewPortPxFromLonLat(newLonLat);//guiObj.infokOlMap.map.getPixelFromLonLat(newLonLat); $("#ikCancelMPButton").trigger("click"); if(!mch.line) { var geometry = new OpenLayers.Geometry.Point( newLonLat.lon, newLonLat.lat ); mch.point = new OpenLayers.Feature.Vector(geometry); mch.line = new OpenLayers.Feature.Vector( new OpenLayers.Geometry.LineString([mch.point.geometry]) ); mch.callback("create", [mch.point.geometry, mch.getSketch()]); mch.point.geometry.clearBounds(); mch.layer.addFeatures([mch.line, mch.point], {silent: true}); } mch.point.geometry.x = newLonLat.lon; mch.point.geometry.y = newLonLat.lat; mch.callback("modify", [mch.point.geometry, mch.getSketch(), false]); mch.point.geometry.clearBounds(); mch.drawFeature(); mch.drawing = true; mch.lastDown = newPixel; mch.lastUp = newPixel; if(mch.touch) mch.lastTouchPx = mch.lastDown; mch.layer.removeFeatures([mch.point]); mch.point = new OpenLayers.Feature.Vector( new OpenLayers.Geometry.Point(newLonLat.lon, newLonLat.lat) ); mch.line.geometry.addComponent( mch.point.geometry, mch.line.geometry.components.length ); mch.layer.addFeatures([mch.point]); mch.callback("point", [mch.point.geometry, mch.getGeometry()]); mch.callback("modify", [mch.point.geometry, mch.getSketch()]); mch.drawFeature(); delete mch.redoStack; guiObj.infokOlMap.ikMeasureControl.markLayer.redraw(); guiObj.infokOlMap.map.moveTo(newLonLat); } return true; }); }; /**************************************************************** Oikean paneelin avaus/suljenta forceState: boolean - true:show/false:hide ****************************************************************/ function ToggleRightPanel(forceState) { var show = forceState == undefined? $("#ikRightPanel").hasClass("ikHiddenPanel"): forceState; var guiObj = this; if(this.settings.useRightControl) { var tabZ = parseInt($("#ikRightPanel").css("z-index")); if(show) { $("#ikRightPanel").css({"z-index": ""+(tabZ+1)}); $("#ikLeftPanel").css({"z-index": ""+(tabZ-1)}); $(".olControlAttribution").animate({right: (RightPanelWidth+$(".olControlOverviewMapElement:visible").outerWidth()+15)+"px"}, {duration: "fast"}); $(".olControlOverviewMapContainer").animate({right: (RightPanelWidth)+"px"}, {duration: "fast"}); $("#ikRightPanel").animate({ width: RightPanelWidth+"px"}, {duration: "fast", complete: function() { $("#ikRightPanel>.sticky-close").removeClass("ikRPClosedHandle"); if(guiObj.settings.mobile && $("#ikNoInfoCont:visible").length > 0) { $("#ikRightPanel>.sticky-close").addClass("ikRPOpenHandleNoInfo"); $("#ikRightPanel>.sticky-close").removeClass("ikRPClosedHandleNoInfo"); } if(guiObj.settings.oldMobile) { $(".ikInfoBody:visible").buttonscroller(); } } }).removeClass("ikHiddenPanel"); } else { $("#ikRightPanel").animate({width: "0px"}, {duration: "fast", complete: function() { $("#ikRightPanel>.sticky-close").addClass("ikRPClosedHandle"); if(guiObj.settings.mobile && $("#ikNoInfoCont:visible").length > 0) { $("#ikRightPanel>.sticky-close").addClass("ikRPClosedHandleNoInfo"); $("#ikRightPanel>.sticky-close").removeClass("ikRPOpenHandleNoInfo"); } $("#ikRightPanel").css({"z-index": ""+(tabZ-1)}); $("#ikLeftPanel").css({"z-index": ""+(tabZ+1)}); } }).addClass("ikHiddenPanel"); $(".olControlOverviewMapContainer").animate({right: "0px"}, {duration: "fast"}); $(".olControlAttribution").animate({right: ($(".olControlOverviewMapElement:visible").outerWidth()+15)+"px"}, {duration: "fast"}); } } }; /**************************************************************** Tulostuksen valitojen muutostenhallinta ****************************************************************/ function PrintFormChanged() { var guiObj = this; if($("#ikPrintToolCont:visible").length > 0) { if($("#printMScaled:checked").length != 0) { var sizes = { "A4": [210, 297], "A3": [297, 420] }; var res = guiObj.infokOlMap.map.baseLayer.getResolution(); var scale = $("#ikScalePrintSelect>option:selected").val(); var size = $(".ikPrintPaperDirs:checked").val() == "true"? sizes[$(".ikPrintPaperSizes:checked").val()].reverse():sizes[$(".ikPrintPaperSizes:checked").val()]; var sqW = size[0] * scale / (1000 * res); var sqH = size[1] * scale / (1000 * res); var mapC = guiObj.infokOlMap.map.getCenter(); var lpW = guiObj.getLeftPanelVisibleWidth(); var rpW = guiObj.getRightPanelVisibleWidth(); var mapW = $("#"+guiObj.settings.containerId).width(); var mapH = $("#"+guiObj.settings.containerId).height(); mapC = mapC.add(lpW*res/2-rpW*res/2, 0); var mapPXC = guiObj.infokOlMap.map.getPixelFromLonLat(mapC); var corners = [[mapPXC.x-sqW/2, mapPXC.y-sqH/2], [mapPXC.x+sqW/2, mapPXC.y-sqH/2], [mapPXC.x+sqW/2, mapPXC.y+sqH/2], [mapPXC.x-sqW/2, mapPXC.y+sqH/2]]; var pLLs = []; pLLs[0] = guiObj.infokOlMap.map.getLonLatFromPixel(mapPXC.clone().add(sqW/-2,sqH/-2)); pLLs[1] = guiObj.infokOlMap.map.getLonLatFromPixel(mapPXC.clone().add(sqW/2,sqH/-2)); pLLs[2] = guiObj.infokOlMap.map.getLonLatFromPixel(mapPXC.clone().add(sqW/2,sqH/2)); pLLs[3] = guiObj.infokOlMap.map.getLonLatFromPixel(mapPXC.clone().add(sqW/-2,sqH/2)); guiObj.scaledPrintSquare = new OpenLayers.Geometry.Polygon( new OpenLayers.Geometry.LinearRing([ new OpenLayers.Geometry.Point(pLLs[0].lon, pLLs[0].lat), new OpenLayers.Geometry.Point(pLLs[1].lon, pLLs[1].lat), new OpenLayers.Geometry.Point(pLLs[2].lon, pLLs[2].lat), new OpenLayers.Geometry.Point(pLLs[3].lon, pLLs[3].lat), ]) ); $("#printScaledCorners").val(guiObj.scaledPrintSquare.toString()); $("#ikSpSqr_top").remove(); $("#ikSpSqr_right").remove(); $("#ikSpSqr_bottom").remove(); $("#ikSpSqr_left").remove(); var top = new OpenLayers.Util.createDiv("ikSpSqr_top", new OpenLayers.Pixel(corners[0][0],corners[0][1]), new OpenLayers.Size(sqW,0), null, null, "2px solid red", "none", 1.0); var right = new OpenLayers.Util.createDiv("ikSpSqr_right", new OpenLayers.Pixel(corners[1][0],corners[1][1]), new OpenLayers.Size(0,sqH), null, null, "2px solid red", "none", 1.0); var bottom = new OpenLayers.Util.createDiv("ikSpSqr_bottom", new OpenLayers.Pixel(corners[3][0],corners[3][1]), new OpenLayers.Size(sqW,0), null, null, "2px solid red", "none", 1.0); var left = new OpenLayers.Util.createDiv("ikSpSqr_left", new OpenLayers.Pixel(corners[0][0],corners[0][1]), new OpenLayers.Size(0,sqH), null, null, "2px solid red", "none", 1.0); $("#"+guiObj.settings.containerId).append(top); $("#"+guiObj.settings.containerId).append(right); $("#"+guiObj.settings.containerId).append(bottom); $("#"+guiObj.settings.containerId).append(left); $("#ikSpSqr_top").css({"z-index": "9999", position: "absolute"}); $("#ikSpSqr_right").css({"z-index": "9999", position: "absolute"}); $("#ikSpSqr_bottom").css({"z-index": "9999", position: "absolute"}); $("#ikSpSqr_left").css({"z-index": "9999", position: "absolute"}); $("#ikScalePrintSelect").slideDown("normal", function() {guiObj.adjustRPLowerPanels();}); } else { $("#ikScalePrintSelect").slideUp("normal", function() {guiObj.adjustRPLowerPanels();}); $("#printScaledCorners").val(""); $("#ikSpSqr_top").remove(); $("#ikSpSqr_right").remove(); $("#ikSpSqr_bottom").remove(); $("#ikSpSqr_left").remove(); } } }; /**************************************************************** Omien karttanäkymien listauksen näyttö/piilotus show: boolean - näkkyykö vaiko eikö ****************************************************************/ function ShowSavedLinks(show) { var guiObj = this; if(show) { $("#ikSLinkCont").slideDown("normal", function() {guiObj.adjustRPLowerPanels();}); if($("#ikRightPanel").hasClass("ikHiddenPanel")) this.toggleRightPanel(true); } else { $("#ikSLinkCont").slideUp("normal", function() {guiObj.adjustRPLowerPanels();if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false);}); } }; /**************************************************************** Tulostustyökalun näyttö/piilotus show: boolean ****************************************************************/ function ShowPrintTool(show) { var guiObj = this; if(show) { if($(".ikLopCont").length > 0) $(".ikLopCont").siblings(".sticky-close").trigger("click"); $("#ikMeasToolsCont>.ikCloseMeasure:visible").trigger("click"); $("#ikPrintToolCont").slideDown("normal", function() {guiObj.adjustRPLowerPanels();}); if($("#ikRightPanel").hasClass("ikHiddenPanel")) this.toggleRightPanel(true); guiObj.printFormChanged(); } else { $("#ikSpSqr_top").remove(); $("#ikSpSqr_right").remove(); $("#ikSpSqr_bottom").remove(); $("#ikSpSqr_left").remove(); $("#ikPrintToolCont").slideUp("normal", function() {guiObj.adjustRPLowerPanels();if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false);}); } }; /**************************************************************** Reitin mittaustyökalun näyttö/piilotus show: boolean ****************************************************************/ function ShowRouteMeasureTool(show) { var guiObj = this; if(show && !guiObj.settings.mobile && guiObj.settings.useRouteMeasureTool) { guiObj.infokOlMap.rMeasCreated = true; $(".ikCloseMeasure").hide(); $("#ikRestartMPButton").hide(); $("#ikRouteMTitle").show(); $("#ikMTitle").hide(); $("#ikCancelMPButton").hide(); $("#ikMeasSelCont").hide(); $("#ikMeasTip").show(); $("#ikMeasTip").children().show(); var BHtml = "> Aloita mittaus"; if(guiObj.infokOlMap.rMeasActive) { BHtml = "> Uusi mittaus"; } else { $("#ikMeasurement").html("0m"); } $("#ikToggleMeasureButton").html(BHtml); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $("#ikToggleMeasureButton").unbind("click"); $("#ikToggleMeasureButton").bind("click", function() { guiObj.infokOlMap.toggleRouteMeasure(); }); $("#ikMeasToolsCont").slideDown("normal", function() {$("#ikMeasBCont").slideDown("fast", function() {guiObj.adjustRPLowerPanels();});}); if($("#ikRightPanel").hasClass("ikHiddenPanel")) guiObj.toggleRightPanel(true); } else { $("#ikMeasToolsCont").slideUp("normal", function() {if($("#ikCoordCont:visible").length == 0) { $("#ikMeasBCont").slideUp("fast", function() {guiObj.adjustRPLowerPanels();if($(".ikRpElems:visible").length == 0 && !guiObj.infokOlMap.ikMeasureControl)guiObj.toggleRightPanel(false);}); } else { guiObj.adjustRPLowerPanels(); if($(".ikRpElems:visible").length == 0 && !guiObj.infokOlMap.ikMeasureControl)guiObj.toggleRightPanel(false); } }); $("#ikToggleMeasureButton").unbind("click"); if(guiObj.infokOlMap.tmpSelRouteWMS.visibility) { guiObj.infokOlMap.tmpSelRouteWMS.mergeNewParams({"viewParams":""}); guiObj.infokOlMap.tmpSelRouteWMS.setVisibility(false); } $("#ikMeasTip").hide(); $("#ikMeasTip").children().hide(); $("#ikRouteMTitle").hide(); $(".ikCloseMeasure").show(); $("#ikMTitle").show(); $("#ikCancelMPButton").show(); $("#ikMeasSelCont").show(); $("#ikToggleMeasureButton").html("> Pysäytä"); guiObj.infokOlMap.rMeasCreated = false; } } /**************************************************************** Mittatyökalun näyttö/piilotus show: boolean ****************************************************************/ function ShowMeasureTool(show) { var guiObj = this; if(show) { $("#ikRestartMPButton").show(); $("#ikPrintToolCont:visible>.ikCloseCont").trigger("click"); $("#ikMeasToolsCont").slideDown("normal", function() {$("#ikMeasBCont").slideDown("fast", function() {guiObj.adjustRPLowerPanels();});}); if($("#ikRightPanel").hasClass("ikHiddenPanel")) guiObj.toggleRightPanel(true); } else { $("#ikMeasToolsCont").slideUp("normal", function() {if($("#ikCoordCont:visible").length == 0) { $("#ikMeasBCont").slideUp("fast", function() {guiObj.adjustRPLowerPanels();if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false);}); } else { guiObj.adjustRPLowerPanels(); if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false); } }); $("#ikRestartMPButton").hide(); } $("#ikMeasurement").html("0m"); }; /**************************************************************** Koordinaattityökalun näyttö/piilotus show: boolean ****************************************************************/ function ShowCoordTool(show) { var guiObj = this; if(show) { $("#ikMeasurement").hide(); $("#ikCoordCont").slideDown("normal", function() { if($("#routeMark:checked").length != 0) { guiObj.infokOlMap.ikMeasureControl.handler.layer.setVisibility(!guiObj.infokOlMap.ikMeasureControl.handler.layer.getVisibility()); guiObj.infokOlMap.ikMeasureControl.markLayer.setVisibility(!guiObj.infokOlMap.ikMeasureControl.markLayer.getVisibility()); } $("#ikMeasBCont").slideDown("fast", function() {guiObj.adjustRPLowerPanels();});}); if($("#ikRightPanel").hasClass("ikHiddenPanel")) this.toggleRightPanel(true); } else { $("#ikCoordCont").slideUp("normal", function() {if($("#ikMeasToolsCont:visible").length == 0){ $("#ikMeasBCont").slideUp("fast", function() {guiObj.adjustRPLowerPanels();if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false);}); } else { guiObj.adjustRPLowerPanels(); if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false); } }); $("#ikMeasurement").show(); } }; /**************************************************************** Infopaneelin näyttö/piilotus show: boolean ****************************************************************/ function ShowInfoPanel(show) { var guiObj = this; if(show) { $("#ikHelpCont:visible").slideUp(); $("#ikHelpControl").removeClass("ikSelectedTool"); guiObj.showNoInfoPanel(false); $("#ikInfoCont").slideDown(); if($("#ikRightPanel").hasClass("ikHiddenPanel") && !guiObj.settings.mobile) this.toggleRightPanel(true); } else { $("#ikInfoCont").slideUp("normal", function() { if($(".ikHelpBody").html().length > 0){ $("#ikHelpCont").slideDown("normal", function() { if($(".ikRpElems:visible").length == 0) { guiObj.toggleRightPanel(false); } else { $("#ikHelpControl").addClass("ikSelectedTool"); } }); } else { guiObj.showNoInfoPanel(true); if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false); } }); $(".ikInfoBody").html(""); $("#ikAltInfoPanel").html(""); } }; /**************************************************************** "Kohteella ei lisätietoja"-paneelin näyttö/piilotus. Vaihdetaan myös oikean paneelin korvakkeen nuoli harmaaksi jos ei lisätietoja. show: boolean ****************************************************************/ function ShowNoInfoPanel(show) { if(this.settings.mobile) { if(show) { $("#ikNoInfoCont").show(); if($("#ikRightPanel>.sticky-close").hasClass("ikRPClosedHandle")) { $("#ikRightPanel>.sticky-close").addClass("ikRPClosedHandleNoInfo"); } else { $("#ikRightPanel>.sticky-close").addClass("ikRPOpenHandleNoInfo"); } } else { $("#ikNoInfoCont").hide(); $("#ikRightPanel>.sticky-close").removeClass("ikRPClosedHandleNoInfo"); $("#ikRightPanel>.sticky-close").removeClass("ikRPOpenHandleNoInfo"); } } } /**************************************************************** Helpin näyttö/piilotus show: boolean ****************************************************************/ function ShowHelpPanel(show) { var guiObj = this; if(show) { $("#ikInfoCont:visible").slideUp(); $("#ikHelpCont").slideDown(); if($("#ikRightPanel").hasClass("ikHiddenPanel")) guiObj.toggleRightPanel(true); } else { $("#ikHelpCont").slideUp("normal", function() { if($(".ikInfoBody").html().length > 0){ $("#ikInfoCont").slideDown("normal", function() {if($(".ikRpElems:visible").length == 0)guiObj.toggleRightPanel(false);}); } else { if($(".ikRpElems:visible").length == 0) { guiObj.toggleRightPanel(false); $(".olControlOverviewMapContainer").animate({right: "0px"}, {duration: "fast"}); $(".olControlAttribution").animate({right: ($(".olControlOverviewMapElement:visible").outerWidth()+15)+"px"}, {duration: "fast"}); } } }); $(".ikHelpBody").html(""); } }; /**************************************************************** Oikean paneelin alaosan täyttävien komponenttien (info/help) korkeuden säätö. ****************************************************************/ function AdjustRPLowerPanels() { $(".ikRpBottomBody").css({height:($("#"+this.settings.containerId).height()-$("#ikPrintToolCont:visible").outerHeight()-$("#ikRightCtrlsCont").outerHeight()-$("#ikSLinkCont:visible").outerHeight()-40)+"px"}); $(".ikRpBottom").animate({height:($("#"+this.settings.containerId).height()-$("#ikPrintToolCont:visible").outerHeight()-$("#ikRightCtrlsCont").outerHeight()-$("#ikSLinkCont:visible").outerHeight())+"px"}, {duration: "fast"}); }; /**************************************************************** Vasemman reunan päälle tulevan paneelin luonti (feedback/link) html: string - paneelin sisältö closeFunc: function - suljentaruksin toiminto, lopussa return true sulkee paneelin ****************************************************************/ function CreateLeftOverPanel(html, closeFunc) { $(html).appendTo("#"+this.settings.containerId).sticky({draggable: false, top: ($("#ikMapSelCont").outerHeight()+5)+"px", height: ($("#"+this.settings.containerId).height()-$("#ikMapSelCont").outerHeight()-$("#ikAllTrgtBottomSpacer:visible").outerHeight()+7)+"px",//bottom: "0px",height: "100px", backgroundColor: "transparent", fade: "false", fade_opacity: "1.0", width: (TrgtTreeWidth-10)+"px", left:"0px",//left: (TrgtTreeWidth+200)+"px", onclose: closeFunc }).css({"z-index": "99999"});; $(".ikField").trigger("blur"); try { $(".ikLopCont").scrollbarPaper(); var gradScroll = $(".ikLopCont").siblings(".scrollbarpaper-container"); $(gradScroll).addClass("ikGradbg"); $(".scrollbarpaper-track", gradScroll).addClass("ikGradbg"); $(".scrollbarpaper-drag", gradScroll).addClass("ikGbg"); $(".scrollbarpaper-drag-top", gradScroll).addClass("ikGbg"); $(".scrollbarpaper-drag-bottom", gradScroll).addClass("ikGbg"); } catch(e){} }; /**************************************************************** Ruudun keskelle lämähtävän popupin luonti (linkin tallennus, koordinaattilistaus). Leveys, korkeus ja noAutoFit tallennetaan paneelin dataparametreihin, niin ruutuun sovitetutkin paneelit tulee halutun kokoisiksi ruudun koon muuttuessa. id: string - paneelille voi antaa id:n, jolla helppo yksilöidä content: string - sisältö w: number - leveys h: number - korkeus noAutoFit: boolean - sovitetaanko jos w/h yli ruudun hideClose: boolean - sulkuruksin saa piiloon onClose: function - halutessaan sen saa tekeen temppuja suljettaessa ****************************************************************/ function CreatePopPanel(id, content, w, h, noAutoFit, hideClose, onClose) { var guiObj = this; var idAttr = id?"id='"+id+"'" : ""; var prefSize = [w,h]; closeFunc = onClose || function() { return true;}; var mapW = $("#"+guiObj.settings.containerId).width(); var mapH = $("#"+guiObj.settings.containerId).height(); var popT = mapH/2 - h/2; var popL = mapW/2 - w/2; if(!noAutoFit) { if(mapH < h) { h = mapH; popT = 0; } if(mapW < w) { w = mapW; popL = 0; } } var popHtml = "
" +"
" +content +"
" +"
"; $("
"+popHtml+"
").appendTo("#"+guiObj.settings.containerId).sticky({ draggable: false, top: popT+"px", height: h+"px", backgroundColor: "transparent", fade: "false", fade_opacity: "1.0", width: w+"px", left: popL+"px", onclose: hideClose? null:closeFunc }); var tabZ = parseInt($("#ikLeftPanel").css("z-index")); $(".ikPopPanel").css({"z-index": ""+(tabZ+3)}); try { if(!guiObj.settings.oldMobile) { $(".ikPopCenterCont").unbind('.scrollbarPaper'); $(".ikPopCenterCont").removeData('scrollbarPaper'); $(".ikPopCenterCont").siblings(".scrollbarpaper-container").remove(); $(".ikPopCenterCont").scrollbarPaper(); } else { $(".ikPopCenterCont").buttonscroller(); } } catch(e){} }; /**************************************************************** Karttanäkymän tallennusnäkymä show: tallennettava linkki ****************************************************************/ function CreateSaveLinkView(link) { var guiObj = this; var today = new Date().toLocaleString(); var slHtml = "

Linkin tallennus

" +"

Tallennetut linkit näytetään sivua avattaessa ja linkkityökalun yhteydessä, oikean reunan paneelissa. Tallennus tapahtuu selaimen evästeisiin (Huom! evästeiden poistaminen hävittää linkit).

" +"

Kohteen nimi:

" +"

Tallennettu

" +"

Tallennus epäonnistui

" +"

Linkki löytyy jo tallennetuista

"; var slPopW = this.settings.mobile? 500:410; var slPopH = this.settings.mobile? 360:270; this.createPopPanel("ikSaveLinkPop", slHtml, slPopW, slPopH); $(".ikLinkSaveResult").hide(); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[save_view.']").localize("linklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $("#ikSaveCookieButton").click(function() { $(".ikLinkSaveResult").hide(); var oldLinks = guiObj.getCookieLinks(); var lName = $("#ikLinkSaveName").val().replace(new RegExp(">","g"),""); var lEnc = encodeURIComponent(lName); var samename = false; var duplIdx = -1 for(var i in oldLinks) { if(oldLinks[i].indexOf(lEnc+">") == 0) { samename = true; duplIdx = i; } } var EConf = false; if(samename) EConf = confirm($("#ikLinkSaveExists").text()); if(!samename || EConf) { if(EConf) { $("ikSavedLink_"+duplIdx).remove(); oldLinks = $.grep(oldLinks, function(l, idx) { return (idx != duplIdx); }); } /* var lRow = "
"+lName+"
"; $("#ikSLinkList").prepend(lRow); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[saved_links.delete_link']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } try { if(!guiObj.settings.oldMobile) { $("#ikSLinkList").unbind('.scrollbarPaper'); $("#ikSLinkList").removeData('scrollbarPaper'); $("#ikSLinkList").siblings(".scrollbarpaper-container").remove(); $("#ikSLinkList").scrollbarPaper(); } else { $("#ikSLinkList").buttonscroller(); } } catch(e){}*/ var cStr = (oldLinks && oldLinks.length > 0)? oldLinks.join("|")+"|"+lEnc+">"+link : lEnc+">"+link; try { document.cookie= "ik_link-"+"infogis-pvp=" + cStr + "; expires=Fri, 31 Dec 9999 23:59:59 GMT"; $("#ikLinkSaveSuccess").slideDown(); guiObj.updateSaveLinkList(); } catch(c_err) { $("#ikLinkSaveFailed").slideDown(); } } }); $("#ikCancelLinkButton").click(function() { //document.cookie= "ik_link-"+"infogis-pvp=; expires=Thu, 01 Jan 1970 00:00:00 GMT"; $("#ikSaveLinkPop").remove(); }); }; /**************************************************************** Tallennettujen karttanäkymien listauksen päivitys ****************************************************************/ function UpdateSaveLinkList() { var guiObj = this; var savedLinks = guiObj.getCookieLinks(); $("#ikSLinkList").unbind('.scrollbarPaper'); $("#ikSLinkList").removeData('scrollbarPaper'); $("#ikSLinkList").siblings(".scrollbarpaper-container").remove(); if(savedLinks) { var lList = []; $(savedLinks).each(function(i, r) { var separ = r.indexOf(">"); var lEnc = r.substring(0,separ); var name = decodeURIComponent(lEnc); var link = r.substring(separ+1); var mobLink = guiObj.settings.mobile?"t":"f"; lList.push(""); }); lList.reverse(); $("#ikSLinkList").html(lList.join("")); guiObj.showSavedLinks(true); try { if(!guiObj.settings.oldMobile) { $("#ikSLinkList").scrollbarPaper(); } else { $("#ikSLinkList").buttonscroller(); } } catch(e){} } else { $("#ikSLinkList").html(""); } } /**************************************************************** Koordinaattilomakkeiden päivitys ****************************************************************/ function UpdateCoordForms() { if($(".changedForm:visible").hasClass("ikCcforms")) { var cObj = this.settings.coordTool.selection[""+$(".ikCcSelect option:selected").val()]; var proj = cObj.proj; var changed = cObj.get(); var pObj = new OpenLayers.Projection(proj); if(this.infokOlMap.map.baseLayer.maxExtent.toGeometry().containsPoint(new OpenLayers.Geometry.Point(changed.lon, changed.lat).clone().transform(pObj,this.infokOlMap.map.getProjectionObject()))) { this.setMarkControlCc(changed, proj); var wgs = changed.clone().transform(pObj, new OpenLayers.Projection("EPSG:4326")); this.infokOlMap.ikMeasureControl.wgsObj.set(wgs.lat, wgs.lon, "D"); this.setMarkControlWGS(this.infokOlMap.ikMeasureControl.wgsObj); } else { alert("Antamasi koordinaatti meni kartan reunan yli."); return false; } } else if($(".changedForm").hasClass("ikWGSforms")){ var lat, lon, type; var fId = $(".changedForm").attr("id"); var inputs = []; $(".changedForm").children("input").each(function() { inputs.push($(this).val()); }); if(fId == "ikAAAaaaa") { lat = parseFloat(inputs[0]); lon = parseFloat(inputs[1]); type = "D"; } else if(fId == "ikAMS") { lat = [parseFloat(inputs[0]), parseFloat(inputs[1]), parseFloat(inputs[2])]; lon = [parseFloat(inputs[3]), parseFloat(inputs[4]), parseFloat(inputs[5])]; type = "DMS"; } else { lat = [parseFloat(inputs[0]), parseFloat(inputs[1])]; lon = [parseFloat(inputs[2]), parseFloat(inputs[3])]; type = "DM"; } this.infokOlMap.ikMeasureControl.wgsObj.set(lat, lon, type); var tmpLL = new OpenLayers.LonLat(this.infokOlMap.ikMeasureControl.wgsObj.d.lon, this.infokOlMap.ikMeasureControl.wgsObj.d.lat); if(this.infokOlMap.map.baseLayer.maxExtent.toGeometry().containsPoint(new OpenLayers.Geometry.Point(tmpLL.lon, tmpLL.lat).clone().transform(new OpenLayers.Projection("EPSG:4326"),this.infokOlMap.map.getProjectionObject()))) { this.setMarkControlCc(tmpLL, "EPSG:4326"); this.setMarkControlWGS(this.infokOlMap.ikMeasureControl.wgsObj); } else { alert("Antamasi WGS koordinaatti meni kartan reunan yli."); return false; } } return true; } /************************************************************************************* Koordinaattityökalun koordinaattien asettaminen muihin kuin wgs84 -kenttiin. coord: OpenLayers.LonLat - asetettava koordinaatt proj: OpenLayers.Projection - projektiossa fromMap: boolean - tuleeko kutsu karttaa klikkaamalla *************************************************************************************/ function SetMarkControlCc(coord, proj, fromMap) { for(var title in this.settings.coordTool.selection) { var cObj = this.settings.coordTool.selection[title]; if(proj != cObj.proj || fromMap) cObj.set(coord, proj); } }; /************************************************************************************* Koordinaattityökalun wgs84 esitysmuotojen asettaminen kenttiin. wgsObj: Wgs84Format - objekti, joka sisältää käytettävät esitystavat. *************************************************************************************/ function SetMarkControlWGS(wgsObj) { var wgsDegss = $("#ikAAAaaaa").children("input"); $(wgsDegss[0]).val(wgsObj.d.lat); $(wgsDegss[1]).val(wgsObj.d.lon); var wgsDMs = $("#ikMMmm").children("input"); $(wgsDMs[0]).val(wgsObj.dm.lat[0]); $(wgsDMs[1]).val(wgsObj.dm.lat[1].toFixed(2)); $(wgsDMs[2]).val(wgsObj.dm.lon[0]); $(wgsDMs[3]).val(wgsObj.dm.lon[1].toFixed(2)); var wgsDMms = $("#ikMMmmm").children("input"); $(wgsDMms[0]).val(wgsObj.dm.lat[0]); $(wgsDMms[1]).val(wgsObj.dm.lat[1].toFixed(3)); $(wgsDMms[2]).val(wgsObj.dm.lon[0]); $(wgsDMms[3]).val(wgsObj.dm.lon[1].toFixed(3)); var wgsDMSs = $("#ikAMS").children("input"); $(wgsDMSs[0]).val(wgsObj.dms.lat[0]); $(wgsDMSs[1]).val(wgsObj.dms.lat[1]); $(wgsDMSs[2]).val(wgsObj.dms.lat[2].toFixed(3)); $(wgsDMSs[3]).val(wgsObj.dms.lon[0]); $(wgsDMSs[4]).val(wgsObj.dms.lon[1]); $(wgsDMSs[5]).val(wgsObj.dms.lon[2].toFixed(3)); return false; }; /************************************************************************************* Kartan valinta mapName: string - kartan nimi (avain maps.php:ssä) stopMove: boolean - estä siirtymästä kartalle asetettuihin koordinaatteihin *************************************************************************************/ function SelectMap(mapName, stopMove) { var button = $("#ikMap_"+mapName.replace(" ", "_")); if(!ikMaps[mapName]) return; if(!button ||(button && !$(button).hasClass("selMap"))) { var selMap = ikMaps[mapName]; if(this.infokOlMap.setBaseLayer(mapName, selMap.mProj)) { $("#ikMapLink").html(""); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); this.infokOlMap.dimBaseLayer($("#mapOpacSlider").slider("value")/100.0); this.infokOlMap.setNaviLayer(selMap.mNaviMapPref); $(".olLayerGooglePoweredBy", ".ikMapGuiContainer").css({left: (TrgtTreeWidth+5) +"px"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").css({left: (TrgtTreeWidth+5) +"px"}); $(".selMap").removeClass("selMap"); $(".ikMapSelect").removeClass("ikMapSelect_active"); var newName = selMap["mName-"+ikLan] || false; if(newName) $("#ikMapSelection").html(newName); if(button) { $(button).addClass("selMap"); $(button).children(".ikMapSelect").addClass("ikMapSelect_active"); $("#ikLessMaps:visible").trigger("click"); } var vpCent = this.infokOlMap.map.getExtent().getCenterLonLat(); if(!stopMove && selMap.mLonLat) { this.infokOlMap.map.moveTo(selMap.mLonLat); } } $(".olControlAttribution").css({right: (RightPanelWidth+$(".olControlOverviewMapElement:visible").outerWidth()+15)+"px"}); $(".olLayerGooglePoweredBy", ".ikMapGuiContainer").css({left: (TrgtTreeWidth+5) +"px"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").css({left: (TrgtTreeWidth+5) +"px"}); } }; /************************************************************************************* Palauttaa vasemman paneelin leveyden jos paneeli näkyvissä, nollan jos ei *************************************************************************************/ function GetLeftPanelVisibleWidth() { return (this.leftPanelVisible ? TrgtTreeWidth : 0); }; /************************************************************************************* Palauttaa oikean paneelin leveyden jos paneeli näkyvissä, nollan jos ei *************************************************************************************/ function GetRightPanelVisibleWidth() { return ((($("#ikRightPanel").hasClass("ikHiddenPanel") || !this.settings.useRightControl) && !(this.isLoadingHash&&ikHash&&(ikHash.usrPoint||ikHash.infoPanel)))? 0: RightPanelWidth); }; /************************************************************************************* Kutsutaan infomapista, kun kartta vaihtuu *************************************************************************************/ function BaseLayerChanged() { this.setZoomBarPos(); }; /************************************************************************************* Asetetaan zoom-kontrollit kohdalleen, vasen paneeli huomioiden *************************************************************************************/ function SetZoomBarPos() { var left = this.leftPanelVisible? TrgtTreeWidth+25 : 25; $(".olControlPanZoomBar", ".ikMapGuiContainer").css({left: left +"px", top: "70px"}); $(".olControlZoom", ".ikMapGuiContainer").css({left: left +"px", top: "70px"}); }; /************************************************************************************* Huonosti nimetty vasemman paneelin toggle. Legacya, samoin kuin se, että toiminta erilainen kuin oikeassa paneelissa. *************************************************************************************/ function ToggleTrgtTree() { var tabZ = parseInt($("#ikLeftPanel").css("z-index")); var guiObj = this; if($("#ikLeftPanel", ".ikMapGuiContainer").hasClass("hiddenTree")) { var lAlign = TrgtTreeWidth+25+44 > $(".ikMapGuiContainer").width()? $(".ikMapGuiContainer").width()-44:TrgtTreeWidth+25; $("#ikLeftPanel").css({"z-index": ""+(tabZ+1)}); $("#ikRightPanel").css({"z-index": ""+(tabZ-1)}); $("#ikLeftPanel", ".ikMapGuiContainer").removeClass("hiddenTree"); $(".olControlScaleLine", ".ikMapGuiContainer").animate({left: (lAlign+45) +"px"}, {duration: "fast"}); $(".olLayerGooglePoweredBy", ".ikMapGuiContainer").animate({left: (lAlign-20) +"px"}, {duration: "fast"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").animate({left: (lAlign-20) +"px"}, {duration: "fast"}); $(".olControlPanZoomBar", ".ikMapGuiContainer").animate({left: lAlign +"px"}, {duration: "fast"}); $(".olControlZoom", ".ikMapGuiContainer").animate({left: lAlign +"px"}, {duration: "fast"}); $("#ikGPSCenterButtonCont", ".ikMapGuiContainer").animate({left: (lAlign-5) +"px"}, {duration: "fast"}); $("#ikLeftPanel", ".ikMapGuiContainer").animate({width: TrgtTreeWidth+"px"}, {duration: "fast", complete: function() { $("#ikLeftPanel>.sticky-close").removeClass("ikLPClosedHandle"); guiObj.onWindowResize(); } }); this.leftPanelVisible = true; } else { $("#ikLeftPanel", ".ikMapGuiContainer").addClass("hiddenTree"); $(".olControlScaleLine", ".ikMapGuiContainer").animate({left: "70px"}, {duration: "fast"}); $(".olLayerGooglePoweredBy", ".ikMapGuiContainer").animate({left: "2px"}, {duration: "fast"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").animate({left: "2px"}, {duration: "fast"}); $(".olControlPanZoomBar", ".ikMapGuiContainer").animate({left: "25px"}, {duration: "fast"}); $(".olControlZoom", ".ikMapGuiContainer").animate({left: "25px"}, {duration: "fast"}); $("#ikGPSCenterButtonCont", ".ikMapGuiContainer").animate({left: "20px"}, {duration: "fast"}); $("#ikLeftPanel", ".ikMapGuiContainer").animate({width: "0px"}, {duration: "fast", complete: function() { $("#ikLeftPanel>.sticky-close").addClass("ikLPClosedHandle"); $("#ikLeftPanel").css({"z-index": ""+(tabZ-1)}); $("#ikRightPanel").css({"z-index": ""+(tabZ+1)}); guiObj.onWindowResize(); } }); this.leftPanelVisible = false; } }; /************************************************************************************* Haku-containerin korkeuden säätö. act: string - haluttu toiminto (show, hide, update, toggle). *************************************************************************************/ function AdjustSearchCont(act) { var contH = $(".ikMapGuiContainer").innerHeight()-$("#ikMapSelCont").outerHeight(); $("#ikSearchBottomToggle").hide(); $("#ikAllTrgtBottomSpacer").show(); switch(act) { case "show": break; case "hide": contH = $("#ikSearchTitle").outerHeight() + $("#ikSearchBottomSpacer").outerHeight(); break; case "update": if(!$(".ikSearchClosed").hasClass("ikSearchOpen")) contH = $("#ikSearchTitle").outerHeight() + $("#ikSearchBottomSpacer").outerHeight(); break; case "toggle": if($("#ikSearchResultCont:visible").length > 0) {contH = $("#ikSearchTitle").outerHeight() + $("#ikSearchBottomSpacer").outerHeight();} } $("#ikSearchCont").animate({height: contH+"px"}, {duration: "normal", complete: function() { if($(".ikSearchClosed").hasClass("ikSearchOpen")) { $("#ikSearchResultCont").show(); $("#ikSearchBottomToggle").show(); $("#ikAllTrgtBottomSpacer").hide(); } else { $("#ikSearchResultCont").hide(); } if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikAllTrgtCont").buttonscroller(); $("#ikSearchResultCont").buttonscroller(); } else { try{$("#ikAllTrgtCont").scrollbarPaper();}catch(e){} try{$("#ikSearchResultCont").scrollbarPaper();}catch(e){} } } }); }; /************************************************************************************* Sivun koon muuttuessa kutsuttava fuctio. Sovittaa korkeudet ja asettaa palikat paikoilleen *************************************************************************************/ function OnWindowResize() { $("#ikLeftPanel", ".ikMapGuiContainer").css({height: $(".ikMapGuiContainer").height()+"px"}); $("#ikRightPanel").css({height: $(".ikMapGuiContainer").height()+"px"}); $(".ikLeftOverPanel").css({height: ($(".ikMapGuiContainer").height()-$("#ikMapSelCont").outerHeight()-$("#ikAllTrgtBottomSpacer:visible").outerHeight()+7)+"px"}); $(".ikRpBottomBody").css({height:($(".ikMapGuiContainer").height()-$("#ikPrintToolCont:visible").outerHeight()-$("#ikRightCtrlsCont").outerHeight()-$("#ikSLinkCont:visible").outerHeight()-40)+"px"}); $(".ikRpBottom").animate({height:($(".ikMapGuiContainer").height()-$("#ikPrintToolCont:visible").outerHeight()-$("#ikRightCtrlsCont").outerHeight()-$("#ikSLinkCont:visible").outerHeight())+"px"}, {duration: "fast"}); var lAlign = $("#ikLeftPanel", ".ikMapGuiContainer").hasClass("hiddenTree")? 25:TrgtTreeWidth+25; $(".olControlScaleLine", ".ikMapGuiContainer").css({left: (lAlign+45) +"px"}); $(".olLayerGooglePoweredBy", ".ikMapGuiContainer").css({left: (lAlign-20) +"px"}); $(".olLayerGooglePoweredBy", ".olLayerGoogleV3").css({left: (lAlign-20) +"px"}); $(".olControlPanZoomBar", ".ikMapGuiContainer").css({left: lAlign +"px", top: "70px"}); $(".olControlZoom", ".ikMapGuiContainer").css({left: lAlign +"px", top: "70px"}); $("#ikGPSCenterButtonCont", ".ikMapGuiContainer").css({left: (lAlign-5) +"px"}); //$("#ikMiniContPanel").css({left: ($(".ikMapGuiContainer").width()/2 - $("#ikMiniContPanel").width()/2)+"px"}); var mapW = $(".ikMapGuiContainer").width(); var mapH = $(".ikMapGuiContainer").height(); var lPos = (mapW/2 + TrgtTreeWidth/2 - $("#ikMiniContPanel").width()/2 - RightPanelWidth/2); if(lPos < TrgtTreeWidth+30 && TrgtTreeWidth+30 + $("#ikMiniContPanel").width() <= mapW) lPos = TrgtTreeWidth+30; if($(".ikMapGuiContainer").hasClass("igMobile")) lPos = mapW/2 - $("#ikMiniContPanel").width()/2; $("#ikMiniContPanel").css({left: lPos+"px"}); var csH = 0; $("#ikCustomSearchBody").children().each(function() { csH += $(this).height(); }); if(csH > $(".ikMapGuiContainer").innerHeight()- 200) { csH = $(".ikMapGuiContainer").innerHeight()- 200; $("#ikCustomSearchBody").css({height: csH+"px", overflow: "auto", "margin-right": "-5px"}); if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikCustomSearchBody").buttonscroller(); } else { try{$("#ikCustomSearchBody").scrollbarPaper();}catch(e){} } } else { $("#ikCustomSearchBody").css({height: "", overflow: "hidden", "margin-right": "17px"}); if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikCustomSearchBody").buttonscroller(); } else { $("#ikCustomSearchBody").unbind('.scrollbarPaper'); $("#ikCustomSearchBody").removeData('scrollbarPaper'); $("#ikCustomSearchBody").siblings(".scrollbarpaper-container").remove(); } } $("#ikCustomSearchBody").data("height-data", $("#ikCustomSearchBody").height()); if($(".ikSearchClosed").hasClass("ikSearchOpen")) { var contH = $(".ikMapGuiContainer").innerHeight()-$("#ikMapSelCont").outerHeight(); $("#ikSearchCont").css({height: contH+"px"}); } $("#ikSearchResultCont").css({top: ($("#ikSearchTitle").height()+10)+"px"}); var treeH =$(".ikMapGuiContainer").innerHeight()-$("#ikMapSelCont").outerHeight()-$("#ikSearchTitle").outerHeight()-$("#ikSearchBottomSpacer").outerHeight()-$("#ikAllTrgtBottomSpacer:visible").outerHeight()-11; if($("#ikCustomSearchBody:visible").length > 0) treeH += $("#ikCustomSearchBody").data("height-data"); $("#ikAllTrgtCont").css({height: treeH+"px"}); $("div.olControlMousePosition").css({"z-index": "99999", left: ($(".ikMapGuiContainer").width()/2+TrgtTreeWidth/2-107-RightPanelWidth/2)+"px"}); if($(".ikPopPanel").length != 0) { var popPref = $(".ikPopPanel").data("pref_size"); var popW = popPref[0]; var popH = popPref[1]; var popT = mapH/2 - popH/2; var popL = mapW/2 - popW/2; if($(".ikPopPanel").data("noautofit") != "true") { if(mapH < popH) { popH = mapH; popT = 0; } if(mapW < popW) { popW = mapW; popL = 0; } } $(".ikPopPanel").css({top:popT+"px",left:popL+"px",width:popW+"px",height:popH+"px",}); } if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikAllTrgtCont").buttonscroller(); $("#ikSearchResultCont").buttonscroller(); $(".ikInfoBody:visible").buttonscroller(); } else { try{$("#ikAllTrgtCont").scrollbarPaper();}catch(e){} try{$("#ikSearchResultCont").scrollbarPaper();}catch(e){} try{$(".ikInfoBody:visible").scrollbarPaper();}catch(e){} } }; /************************************************************************************* Merkitsee kohteen valituksi listasta (huom. ei ruksi vaan valinta). trgtId: string - kohteen id *************************************************************************************/ function MarkSelected(trgtId) { $(".ikSelectedOnList").removeClass("ikSelectedOnList"); $("."+trgtId+">.ttRowTitle>.ikTrgtName").addClass("ikSelectedOnList"); $("."+trgtId+">.usrTRowTitle>.ikUsrTrgtName").addClass("ikSelectedOnList"); $("."+trgtId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").addClass("ikSelectedOnList"); }; /************************************************************************************* Poistaa valinnan kaikista ryhmän kohteista. clearButton: $(elem) - klikattu tyhjennysruksielementti *************************************************************************************/ function ClearGroup(clearButton) { var guiObj = this; $(clearButton).unbind("click"); var trgtsToRem = []; $(clearButton).siblings(".ikTrgt_select").removeClass("ikTrgt_selected"); $(clearButton).siblings(".ikTrgt_select").removeClass("ikTrgt_some"); $(clearButton).siblings(".ikTrgt_Noselect").removeClass("ikTrgt_Nosome"); $(clearButton).siblings(".ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); $(clearButton).removeClass("ikXmarks"); var grpId = $(clearButton).closest(".ttRow").attr("id"); var ttBody = $(clearButton).parents(".ttRowTitle:first").siblings(".ttRowBody"); if($("."+grpId).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$("."+grp).data("overlay"), false); } $(ttBody).find(".ikTrgt_selected").each(function() { var tmpId = $(this).closest(".ttRow").attr("id"); $("."+tmpId+">.ttRowTitle>.ikTrgt_select").removeClass("ikTrgt_selected"); $("."+tmpId+">.ttRowTitle>.ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); if($("."+tmpId).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$("."+tmpId).data("overlay"), false); } if($("."+tmpId).data("ttype") != 0) { if($("."+tmpId, "#ikTTCont").hasClass("ikTrgt_onMap"))trgtsToRem.push(tmpId); $("."+tmpId+">.ttRowTitle>.ikTrgtName", "#ikTTCont").removeClass("ikSelectedOnList"); $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").removeClass("ikTrgt_selected"); $("."+tmpId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").removeClass("ikTrgt_selected"); $("."+tmpId, "#ikTTCont").removeClass("ikTrgt_onMap"); $("."+tmpId, "#ikSearchResultCont").removeClass("ikTrgt_onMap"); } }); $(".ikTrgt_select", ttBody).removeClass("ikTrgt_some"); $(".ikTrgt_Noselect", ttBody).removeClass("ikTrgt_Nosome"); $(".ikTrgtName", ttBody).removeClass("ikHasSelectedTrgtsGroupTitle"); $(".ikClearGroup", ttBody).removeClass("ikXmarks"); this.checkParents($(clearButton).closest(".ttRow")); for(var trgtId in guiObj.selectedSearch) { if($.inArray(grpId, guiObj.selectedSearch[trgtId]) >= 0) { $("."+trgtId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").removeClass("ikTrgt_selected"); $("."+trgtId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); trgtsToRem.push(trgtId); delete guiObj.selectedSearch[trgtId]; } } if(trgtsToRem.length > 0) { guiObj.infokOlMap.remFeatures(trgtsToRem); guiObj.setRoutes = separateArray(trgtsToRem, guiObj.setRoutes); if(guiObj.setRoutes.length == 0 && guiObj.infokOlMap.rMeasCreated) { guiObj.infokOlMap.rMeasActive = false; guiObj.showRouteMeasureTool(false); } } }; /************************************************************************************* Käy läpi ruksatun kohteen/ryhmän yläryhmät ja pyytää niihin asianmukaisen ruksauksen checked: $(elem) - klikattu ruksielementti *************************************************************************************/ function CheckParents(checked) { var guiObj = this; if(checked.data("ttype") == 0) { checked.parents(".ttRow").each(function() { guiObj.checkGroup($(this).attr("id")); }); } else { var remFromSearch = null; var parent = checked.parents("#ikSearchResultCont")[0] if(checked.parents("#ikSearchResultCont").length > 0 ) { remFromSearch = !checked.hasClass("ikTrgt_onMap"); } else { parent = $("#"+checked.data("parentid")); } var trgts = $(parent).data("trgts"); if(trgts) { var chId = checked.attr("id"); var parentData = trgts[chId]; if(parentData["parents"]) { $(parentData["parents"]).each(function() { guiObj.checkGroup(""+this, remFromSearch); }); } } } }; /************************************************************************************* Asettaa ryhmän ruksin. Kutsutaan CheckParents-functiosta. gid: string - ryhmän id. on: boolean/null - oliko kutsuva lapsielementti ruksattu vai ei *************************************************************************************/ function CheckGroup(gid, on) { var guiObj = this; if(gid && $("#"+gid)) { var elemBody = $("#"+gid+">.ttRowBody"); var selected = elemBody.find(".ikTrgt_onMap").length; var trgts = elemBody.find(".hasData").length; var emptyGrps = elemBody.find(".ttRow:not('.hasData')>.ttRowBody:empty").length; var grps = elemBody.find(".ttRow:not('.hasData')").length; if(emptyGrps == 0 && trgts != 0 && trgts == selected) { $("."+gid+">.ttRowTitle>.ikTrgt_select").addClass("ikTrgt_selected"); $("."+gid+">.ttRowTitle>.ikTrgt_select").removeClass("ikTrgt_some"); $("."+gid+">.ttRowTitle>.ikTrgt_Noselect").removeClass("ikTrgt_Nosome"); $("."+gid+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+gid+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); } else if((selected == 0 && on == null) || ((emptyGrps == grps || grps == 0) && on)) { $("."+gid+">.ttRowTitle>.ikTrgt_select").removeClass("ikTrgt_selected"); $("."+gid+">.ttRowTitle>.ikTrgt_select").removeClass("ikTrgt_some"); $("."+gid+">.ttRowTitle>.ikTrgt_Noselect").removeClass("ikTrgt_Nosome"); $("."+gid+">.ttRowTitle>.ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); $("."+gid+">.ttRowTitle>.ikClearGroup").removeClass("ikXmarks"); if($("."+gid).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$("."+gid).data("overlay"), false); } } else { $("."+gid+">.ttRowTitle>.ikTrgt_select").removeClass("ikTrgt_selected"); $("."+gid+">.ttRowTitle>.ikTrgt_select").addClass("ikTrgt_some"); $("."+gid+">.ttRowTitle>.ikTrgt_Noselect").addClass("ikTrgt_Nosome"); $("."+gid+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+gid+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); } } }; /************************************************************************************* Näyttää ikHashiin linkitetyn kohteen infon/viestin. *************************************************************************************/ function ShowUsrTrgtMessage() { if(ikHash.usrMessage && ikHash.usrMessage.length > 0) { if(this.settings.altInfoPanel) { $("#"+this.settings.altInfoPanel).html("
"+ikHash.usrMessage+"
"); } else { $(".ikInfoBody").html(ikHash.usrMessage); this.showInfoPanel(true); $("#ikInfoCont").data({"trgtid": null, "infoid": null}); } } }; /************************************************************************************* Linkitetyn kohteen valinta. trgt: $(elem) - kohteen title-elementti. *************************************************************************************/ function SelectUsrTarget(trgt) { var trgtId = $(trgt).parent(".usrTRow").attr("id"); this.markSelected(trgtId); var trgtBounds = this.uPoint.geometry.getBounds(); this.infokOlMap.map.moveTo(trgtBounds.getCenterLonLat()); this.showUsrTrgtMessage(); if(!$("."+trgtId+">.usrTRowTitle:first>.ikUsrTrgt_select").hasClass("ikTrgt_selected")) { this.checkUsrTarget($(trgt).children(".ikUsrTrgt_select")); this.infokOlMap.ikTrgtCtrl.unselectAll({except: this.uPoint}); this.infokOlMap.ikTrgtCtrl.select(this.uPoint); } if(this.settings.mobile)this.toggleTrgtTree(); }; /************************************************************************************* Kohteen valinta. trgt: $(elem) - kohteen title-elementti. *************************************************************************************/ function SelectTarget(trgt) { var guiObj = this; var trgtId = $(trgt).parent(".ttRow").attr("id"); var trgtType = $(trgt).parent(".ttRow").data("ttype"); if(trgtType == 0) { if($(trgt).siblings(".ttRowBody").children(".ttRow").length > 0) { $(trgt).children(".ikGroupOpen").toggleClass("ikGroupClose"); $(trgt).children(".ikTrgtName").toggleClass("ikOpenGroupTitle"); $(trgt).siblings(".ttRowBody:first").slideToggle("normal", function() { if(guiObj.settings.oldMobile) { $("#ikAllTrgtCont").buttonscroller(); } else { try{$("#ikAllTrgtCont").scrollbarPaper();}catch(e){} } }); } else { this.loadTargets(trgtId); } } else { this.markSelected(trgtId); var trgtData = $("#"+$(trgt).closest(".ttRow").data("parentid")).data("trgts")[trgtId]; var partId = trgtData["partid"] || null; this.loadTrgtInfo(trgtId, partId); if(trgtType == 4) { var addrStr = $("."+trgtId+">.ttRowTitle>.ikTrgtName").text(); if(addrStr.lastIndexOf(',') != -1) addrStr = addrStr.substring(0, addrStr.lastIndexOf(',')); $("#ikSearchBar").val(addrStr); $("#ikSearchBar").focus(); } var tmpBbox = trgtData["bbox"]; this.infokOlMap.showBounds(new OpenLayers.Bounds(tmpBbox[0],tmpBbox[1],tmpBbox[2],tmpBbox[3])); if($("."+trgtId+">.ttRowTitle:first>.ikTrgt_select").length > 0) { if(!$("."+trgtId+">.ttRowTitle:first>.ikTrgt_select").hasClass("ikTrgt_selected")) { this.checkTarget($(trgt).children(".ikTrgt_select")); } if(partId) { this.infokOlMap.selPids([[trgtId,partId]]); } else { this.infokOlMap.selTrgts(trgtId); } }else if($("."+trgtId).data("mappref")) { this.selectMap(""+$("."+trgtId).data("mappref"), true); if(partId) { this.infokOlMap.selPids([[trgtId,partId]]); } else { this.infokOlMap.selTrgts(trgtId); } } if(this.settings.mobile)this.toggleTrgtTree(); } }; function CheckUsrTarget(trgtCheck) { var tmpId = $(trgtCheck).closest(".usrTRow").attr("id"); $("#ikMapLink").html(""); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); if($(trgtCheck).hasClass("ikTrgt_selected")) { $(trgtCheck).removeClass("ikTrgt_selected"); $("."+tmpId+">.usrTRowTitle>.ikUsrTrgtName").removeClass("ikSelectedOnList"); this.infokOlMap.usrLayer.removeFeatures([this.uPoint]); this.infokOlMap.selectedTrgts = separateArray([this.uPoint.fid], this.infokOlMap.selectedTrgts); this.infokOlMap.selectedParts = separateArray([this.uPoint.fid], this.infokOlMap.selectedParts); } else { $(trgtCheck).addClass("ikTrgt_selected"); this.infokOlMap.usrLayer.addFeatures([this.uPoint]); } }; /************************************************************************************* Kohteen ruksaus. trgtCheck: $(elem) - kohteen ruksielementti callerChecked: number - sisäkkäisissä kutsuissa käytettävä muuttuja, tilat (<1,1,>1). jos jätetään asettamatta, oletus on 1. *************************************************************************************/ function CheckTarget(trgtCheck, callerChecked) { var guiObj = this; var calChecked = callerChecked || 1; $("#ikMapLink").html(""); $(".ikLinkResults").hide(); $("#ikSaveLinkPop").remove(); var tmpId = $(trgtCheck).closest(".ttRow").attr("id"); var tmpData = $("#"+$(trgtCheck).closest(".ttRow").data("parentid")).data("trgts")[tmpId]; var isThisOn = 0; $("."+tmpId+" .ikTrgt_select").removeClass("ikTrgt_some"); if($(trgtCheck).hasClass("ikTrgt_selected") && calChecked <= 1) { $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").removeClass("ikTrgt_selected"); $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").removeClass("ikTrgt_selected"); if($("."+tmpId).data("overlay")) { this.infokOlMap.setOverlay(""+$("."+tmpId).data("overlay"), false); } var sParents = this.selectedSearch[tmpId]; if(sParents) { delete this.selectedSearch[tmpId]; } if($("."+tmpId).data("ttype") == 0) { $("."+tmpId+">.ttRowTitle>.ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); $("."+tmpId+">.ttRowTitle>.ikClearGroup").removeClass("ikXmarks"); var trgtsToRem = []; var partsToRem = []; $("."+tmpId+">.ttRowBody").find(".ttRow").each(function() { var childId = $(this).attr("id"); if($(this).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$(this).data("overlay"), false); } if($(this).data("ttype") != 0) { var childData = $("."+tmpId).data("trgts")[childId]; if($(this).data("ttype") >= 4) { this.infokOlMap.selectedTrgts = separateArray([this.addrsOnMap[childId].fid], this.infokOlMap.selectedTrgts); this.infokOlMap.selectedParts = separateArray([this.addrsOnMap[childId].fid], this.infokOlMap.selectedParts); this.infokOlMap.usrLayer.removeFeatures([this.addrsOnMap[childId]]); delete this.addrsOnMap[childId]; } else { var partId = childData?childData["partid"]:null; if(partId) { partsToRem.push(partId); } else { trgtsToRem.push(childId); } } guiObj.trgtBuffer = $.grep(guiObj.trgtBuffer, function(gid) {return (childId != gid);}); $("."+childId+">.ttRowTitle>.ikTrgtName", "#ikTTCont").removeClass("ikSelectedOnList"); $("."+childId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").removeClass("ikTrgt_selected"); $("."+childId, "#ikTTCont").removeClass("ikTrgt_onMap"); $("."+childId, "#ikSearchResultCont").removeClass("ikTrgt_onMap"); } else { guiObj.waitingGroups = $.grep(guiObj.waitingGroups, function(gid) {return (childId != gid);}); $("."+childId+">.ttRowTitle>.ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); $("."+childId+">.ttRowTitle>.ikClearGroup").removeClass("ikXmarks"); } $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").removeClass("ikTrgt_selected"); }); if(trgtsToRem.length > 0) { this.infokOlMap.remFeatures(trgtsToRem); } if(partsToRem.length > 0) { this.infokOlMap.remParts(partsToRem); } guiObj.setRoutes = separateArray(trgtsToRem, guiObj.setRoutes); if(guiObj.setRoutes.length == 0 && guiObj.infokOlMap.rMeasCreated) { guiObj.infokOlMap.rMeasActive = false; guiObj.showRouteMeasureTool(false); } } else { if($("."+tmpId).data("ttype") >= 4) { this.infokOlMap.selectedTrgts = separateArray([this.addrsOnMap[tmpId].fid], this.infokOlMap.selectedTrgts); this.infokOlMap.selectedParts = separateArray([this.addrsOnMap[tmpId].fid], this.infokOlMap.selectedParts); this.infokOlMap.usrLayer.removeFeatures([this.addrsOnMap[tmpId]]); delete this.addrsOnMap[tmpId]; } else { this.trgtBuffer = $.grep(this.trgtBuffer, function(gid) {return (tmpId != gid);}); var partId = tmpData["partid"]; if(partId) { this.infokOlMap.remParts(partId); } else { this.infokOlMap.remFeatures(tmpId); } this.setRoutes = separateArray([tmpId], this.setRoutes); if(this.setRoutes.length == 0 && this.infokOlMap.rMeasCreated) { this.infokOlMap.rMeasActive = false; this.showRouteMeasureTool(false); } } $("."+tmpId+">.ttRowTitle>.ikTrgtName").removeClass("ikSelectedOnList"); $("."+tmpId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); $("."+tmpId, "#ikTTCont").removeClass("ikTrgt_onMap"); $("."+tmpId, "#ikSearchResultCont").removeClass("ikTrgt_onMap"); } } else if(calChecked >= 1){ isThisOn = 1; $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").addClass("ikTrgt_selected"); $("."+tmpId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").addClass("ikTrgt_selected"); if(!callerChecked && $("."+tmpId).data("mappref")) { this.selectMap(""+$("."+tmpId).data("mappref"), true); } if($("."+tmpId).data("overlay")) { this.infokOlMap.setOverlay(""+$("."+tmpId).data("overlay"), true); } if($(trgtCheck).parents("#ikSearchResultCont").length != 0 && tmpData["parents"]) { this.selectedSearch[tmpId] = tmpData["parents"]; } if($("."+tmpId).data("ttype") == 0) { $("."+tmpId+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+tmpId+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); if($("."+tmpId).find(".ttRowBody:parent").length == 0) { this.loadTargets(tmpId); } else { var childrenToAdd = []; var partsToAdd = []; $("."+tmpId+">.ttRowBody").find(".ttRow").each(function() { var childId = $(this).attr("id"); if($(this).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$(this).data("overlay"), true); } if($(this).data("ttype") != 0) { var childData = $("."+tmpId).data("trgts")[childId]; if($("."+childId).data("ttype") >= 4) { var tmpBbox = childData["bbox"]; var addrLoc = new OpenLayers.Bounds(tmpBbox[0],tmpBbox[1],tmpBbox[2],tmpBbox[3]).getCenterLonLat().transform(new OpenLayers.Projection("EPSG:2393"), this.infokOlMap.map.getProjectionObject());//!!! Täällä on vakiona asetettu projektio! var addrStr = $("."+childId+">.ttRowTitle>.ikTrgtName").text(); var addrPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(addrLoc.lon, addrLoc.lat), {iksymbol: "RedBall18.gif", "ikdescription": addrStr, "objectid": ""+childId, "partid": ""+childId}); addrPoint.fid = ""+childId; this.addrsOnMap[""+childId] = addrPoint; this.infokOlMap.usrLayer.addFeatures([addrPoint]); } else { var partId = childData?childData["partid"]:null; if(partId) { partsToAdd.push(partId); } else { childrenToAdd.push(childId); } if($(this).data("ttype") == 2)guiObj.setRoutes.push(""+childId); } $("."+childId, "#ikTTCont").addClass("ikTrgt_onMap"); $("."+childId, "#ikSearchResultCont").addClass("ikTrgt_onMap"); $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").addClass("ikTrgt_selected"); } else if($("."+childId).find(".ttRowBody:parent").length == 0) { guiObj.loadTargets(childId); } else { $("."+childId+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+childId+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); } $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").addClass("ikTrgt_selected"); }); if(childrenToAdd.length > 0) { this.infokOlMap.addFeatures(childrenToAdd); } if(partsToAdd.length > 0) { this.infokOlMap.addParts(partsToAdd); } if(guiObj.setRoutes.length > 0 && !guiObj.infokOlMap.rMeasCreated && !guiObj.infokOlMap.ikMeasureControl) guiObj.showRouteMeasureTool(true); } } else { if($("."+tmpId).data("ttype") >= 4) { var tmpBbox = tmpData["bbox"]; var addrLoc = new OpenLayers.Bounds(tmpBbox[0],tmpBbox[1],tmpBbox[2],tmpBbox[3]).getCenterLonLat().transform(new OpenLayers.Projection("EPSG:2393"), this.infokOlMap.map.getProjectionObject());//!!! Täällä on vakiona asetettu projektio! var addrStr = $("."+tmpId+">.ttRowTitle>.ikTrgtName").text(); var addrPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(addrLoc.lon, addrLoc.lat), {iksymbol: "RedBall18.gif", "ikdescription": addrStr, "objectid": ""+tmpId, "partid": ""+tmpId}); addrPoint.fid = ""+tmpId; this.addrsOnMap[""+tmpId] = addrPoint; this.infokOlMap.usrLayer.addFeatures([addrPoint]); } else { var partId = tmpData["partid"]; if(partId) { this.infokOlMap.addParts([partId]); } else { this.infokOlMap.addFeatures(tmpId); } if($("."+tmpId).data("ttype") == 2)guiObj.setRoutes.push(""+tmpId); if(guiObj.setRoutes.length > 0 && !guiObj.infokOlMap.rMeasCreated && !guiObj.infokOlMap.ikMeasureControl) guiObj.showRouteMeasureTool(true); } $("."+tmpId).addClass("ikTrgt_onMap"); } } if($("."+tmpId).data("ttype") != 0 && $(trgtCheck).closest(".ttRow:not('.has_data')").hasClass("ikSelectAll") && isThisOn == 1) { var parentToCheck = $("."+tmpId).parents(".ttRow:first").attr("id"); if(!$("."+parentToCheck+">.ttRowTitle>.ikTrgt_select").hasClass("ikTrgt_selected")) this.checkTarget($("."+parentToCheck+">.ttRowTitle>.ikTrgt_select")[0]); } else { guiObj.checkParents($(trgtCheck).closest(".ttRow")); } return false; }; /************************************************************************************* Kuntavalinta. sel: elem - valittu rivi *************************************************************************************/ function SelectCounty(sel) { this.infokOlMap.remAllFeatures(); var theme1 = this.selTheme; var theme2 = (this.selTheme == 1 || this.selTheme == "")? 10000:this.selTheme; var county1 = this.selCounty; var county2 = (this.selCounty == 1 || this.selCounty == "")? 10000:this.selCounty; for(var map in ikMaps) { if(!ikMaps[map].mLayer.isBaseLayer) { ikMaps[map].mLayer.setVisibility(false); ikMaps[map].mLayer.mergeNewParams({"viewParams":"county1:"+county1+";county2:"+county2+";theme1:"+theme1+";theme2:"+theme2+";clientId:"+ikClient}); } } var mpref = $(sel).data("mappref"); if(mpref) this.selectMap(mpref, true); var lonlat = $(sel).data("lonlat"); if(lonlat) this.infokOlMap.map.moveTo(new OpenLayers.LonLat(lonlat[0], lonlat[1])); this.loadTargets(null); }; /************************************************************************************* Teemavalinta. sel: elem - valittu rivi *************************************************************************************/ function SelectTheme(sel) { this.infokOlMap.remAllFeatures(); var theme1 = this.selTheme; var theme2 = (this.selTheme == 1 || this.selTheme == "")? 10000:this.selTheme; var county1 = this.selCounty; var county2 = (this.selCounty == 1 || this.selCounty == "")? 10000:this.selCounty; for(var map in ikMaps) { if(!ikMaps[map].mLayer.isBaseLayer) { ikMaps[map].mLayer.setVisibility(false); ikMaps[map].mLayer.mergeNewParams({"viewParams":"county1:"+county1+";county2:"+county2+";theme1:"+theme1+";theme2:"+theme2+";clientId:"+ikClient}); } } var mpref = $(sel).data("mappref"); if(mpref) this.selectMap(mpref, true); var lonlat = $(sel).data("lonlat"); if(lonlat) this.infokOlMap.map.moveTo(new OpenLayers.LonLat(lonlat[0], lonlat[1])); this.loadTargets(null); }; /*********************************************************************************** * * Lataus-kilkkeet * ***********************************************************************************/ /************************************************************************************* Customhaun kohdemäärän lataus. Callbackit muokkaavat lomakkeen hakunappia. search: string - customhaun lomake serialisoituna. *************************************************************************************/ function CustomSearchTargetCount(search) { var guiObj = this; $.ajax({ type: "POST", dataType: "text", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/customsearchcount.php?customer=infogis-pvp", async: true, data: "sWord=&"+search+"&lan="+ikLan+"&clientId="+ikClient, success: function(text) { var bText = $("#ikCustomSearchButton").html(); var insP = bText.indexOf("("); if(insP == -1) { $("#ikCustomSearchButton").html(bText+" ("+text+")"); } else { $("#ikCustomSearchButton").html(bText.substring(0,insP)+"("+text+")"); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { var bText = $("#ikCustomSearchButton").html(); var insP = bText.indexOf("("); if(insP != -1)$("#ikCustomSearchButton").html(bText.substring(0,insP-1)); return true; } }); return true; }; /************************************************************************************* Haun lataus. Käyttää kohdelatauksen handleria. word: string - hakusana/sanat incParents: boolean - varalle jätetty parametri ryhmien sisällyttämisestä hakuun customSearch: boolean - true = customhakulomkkeelta tuleva haku (sWord jätetään tyhjäksi) *************************************************************************************/ function LoadSearchTargets(word, incParents, customSearch) { this.infokOlMap.showLoad(true); var guiObj = this; var bounds = ""; var sParams = customSearch? "sWord=&"+word: "sWord="+word; if(this.infokOlMap.partsOnMap.length > 0) { this.infokOlMap.remParts(this.infokOlMap.partsOnMap); } if(this.curSearch) this.curSearch.abort(); this.curSearch = $.ajax({ type: "POST", dataType: "json", timeout: 60000, url: "https://kartta.jict.fi/infogis-pvp/php/trgt.json.php?customer=infogis-pvp", async: true, data: sParams+"&incParents="+incParents+"&sBounds="+bounds+"&lan="+ikLan+"&clientId="+ikClient, success: function(json) { guiObj.handleTargets("ikSearchResultCont", json, guiObj); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { try{console.log(textStatus+": "+errorThrown);}catch(e){} guiObj.infokOlMap.showLoad(false); return true; } }); return false; }; function LoadTargets(parentId, silent) { var guiObj = this; if(!silent)guiObj.infokOlMap.showLoad(true); var countySel = guiObj.selCounty? guiObj.selCounty:""; var themeSel = guiObj.selTheme? guiObj.selTheme:""; $.ajax({ type: "POST", dataType: "json", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/trgt.json.php?customer=infogis-pvp", async: true, data: "pid="+parentId+"&county="+countySel+"&theme="+themeSel+"&lan="+ikLan+"&clientId="+ikClient, success: function(json) { if(guiObj.trgtLoadCounter[""+parentId]) { delete guiObj.trgtLoadCounter[""+parentId]; if(guiObj.reloadTimer) { window.clearTimeout(guiObj.reloadTimer); guiObj.reloadTimer = null; } } guiObj.handleTargets(parentId, json, guiObj, silent); if(!silent)guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { try{console.log(textStatus+": "+errorThrown);}catch(e){} if(!silent)guiObj.infokOlMap.showLoad(false); if(guiObj.trgtLoadCounter[""+parentId] == undefined) { guiObj.trgtLoadCounter[""+parentId] = 0; } else { guiObj.trgtLoadCounter[""+parentId]++; } if(guiObj.trgtLoadCounter[""+parentId] != undefined && guiObj.trgtLoadCounter[""+parentId] < 3) { guiObj.reloadTimer = window.setTimeout( OpenLayers.Function.bind(guiObj.loadTargets, guiObj, parentId), 500 ); } return true; } }); return false; }; function HandleTargets(parentId, json, guiObj, silent) { var parentSelected = false; if($("."+parentId+">.ttRowTitle>.ikTrgt_select").hasClass("ikTrgt_selected")) { parentSelected = true; } var isSearch = (parentId == "ikSearchResultCont"); var hasAddr = (guiObj.addrsOnMap && !$.isEmptyObject(guiObj.addrsOnMap)); var loadingHash = (guiObj.hashGroups && guiObj.hashGroups.length > 0); var secSearchGroup = []; var tmpContent = []; var childrenToLoad = []; var addrNotToRem = []; var forParentChck = []; var insertContainer; if(parentId == null) { insertContainer = "#ikTTCont"; parentId = "ikTTCont"; } else if(isSearch) { insertContainer = "#"+parentId; } else { insertContainer = "#"+parentId+">.ttRowBody"; } try { var trgtsToAdd = []; var trgts = json["targets"]; for(var trgtId in trgts) { var tmpHTML = ""; var id = trgtId; var duplicate = undefined; if(isSearch) { if(hasAddr && !$.isEmptyObject(guiObj.addrsOnMap[id])) { addrNotToRem.push(id); } } var trgt = trgts[trgtId]; var name = trgt["name"]; var type = trgt["type"]; var mapPref = trgt["mapPref"]; var overlay = trgt["overlay"]; var isCheckable = trgt["checkable"]; var selectAll = trgt["selectAll"]; var selTrgt = ($.inArray(id, guiObj.infokOlMap.trgtsOnMap) != -1); tmpHTML += "
.ttRowTitle>.ikTrgt_select").addClass("ikTrgt_selected"); $("."+id).addClass("ikTrgt_onMap"); } } tmpHTML += "'>
"; if(type == 0) { tmpHTML += "
"; } else { tmpHTML += "
"; } if(!duplicate) { tmpHTML += "
"; if(type == 0 && !guiObj.settings.oldMobile) { tmpHTML += "
"; } tmpHTML += "
"; if(type != 0) { tmpHTML += " "; } tmpHTML += "
"; if(isSearch && type == 4) { secSearchGroup.push(tmpHTML); } else { tmpContent.push(tmpHTML); } } if(isSearch) { var results = ""; if(secSearchGroup.length > 0) results += "
Osoitteen mukaiset tulokset
("+secSearchGroup.length+")
"+secSearchGroup.join("")+"
"; if(tmpContent.length > 0) results += "
Vapaan haun mukaiset tulokset
("+tmpContent.length+")
"+tmpContent.join("")+"
"; $(insertContainer).html(results); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[search-titles.addr-sg']").localize("searchlan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize[search-titles.free-sg']").localize("searchlan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $(".ikSGTitle").bind("click", function() { if($(this).children(".ikSGClosed").hasClass("ikSGOpen")) { $(this).siblings(".ikSGBody").slideUp(); $(this).children(".ikSGClosed").removeClass("ikSGOpen"); $(this).children(".ikGroupOnList").removeClass("ikOpenGroupTitle"); } else { $(this).siblings(".ikSGBody").slideDown(); $(this).children(".ikSGClosed").addClass("ikSGOpen"); $(this).children(".ikGroupOnList").addClass("ikOpenGroupTitle"); } }); $(".ikSG_select").click(function() { var tmpId = $(this).closest(".ikSGCont").attr("id"); if($(this).hasClass("ikTrgt_selected")) { var trgtsToRem = []; var pidsToRem = []; $("#"+tmpId+">.ikSGBody").find(".ttRow").each(function() { var childId = $(this).attr("id"); if($(this).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$(this).data("overlay"), false); } if($(this).data("ttype") != 0) { var trgtData = $("#"+$(this).data("parentid")).data("trgts")[childId]; var partId = trgtData["partid"] || null; $("."+childId+">.ttRowTitle>.ikTrgtName", "#ikTTCont").removeClass("ikSelectedOnList"); $("."+childId+">.ttRowTitle>.ikTrgtName", "#ikSearchResultCont").removeClass("ikSelectedOnList"); $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").removeClass("ikTrgt_selected"); $("."+childId, "#ikTTCont").removeClass("ikTrgt_onMap"); $("."+childId, "#ikSearchResultCont").removeClass("ikTrgt_onMap"); if($(this).data("ttype") >= 4) { if(guiObj.addrsOnMap && guiObj.addrsOnMap[childId]) { guiObj.infokOlMap.selectedTrgts = separateArray([guiObj.addrsOnMap[childId].fid], guiObj.infokOlMap.selectedTrgts); guiObj.infokOlMap.selectedParts = separateArray([guiObj.addrsOnMap[childId].fid], guiObj.infokOlMap.selectedParts); guiObj.infokOlMap.usrLayer.removeFeatures([guiObj.addrsOnMap[childId]]); delete guiObj.addrsOnMap[childId]; } } else { if(partId) { pidsToRem.push(partId) } else { trgtsToRem.push(childId); } guiObj.checkParents($("#"+childId)); guiObj.trgtBuffer = $.grep(guiObj.trgtBuffer, function(gid) {return (childId != gid);}); } } else { guiObj.waitingGroups = $.grep(guiObj.waitingGroups, function(gid) {return (childId != gid);}); $("."+childId+">.ttRowTitle>.ikTrgtName").removeClass("ikHasSelectedTrgtsGroupTitle"); $("."+childId+">.ttRowTitle>.ikClearGroup").removeClass("ikXmarks"); } $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").removeClass("ikTrgt_selected"); }); if(trgtsToRem.length > 0) { guiObj.infokOlMap.remFeatures(trgtsToRem); guiObj.setRoutes = separateArray(trgtsToRem, guiObj.setRoutes); } if(pidsToRem.length > 0) { guiObj.infokOlMap.remParts(pidsToRem); } if(guiObj.setRoutes.length == 0 && guiObj.infokOlMap.rMeasCreated) { guiObj.infokOlMap.rMeasActive = false; guiObj.showRouteMeasureTool(false); } $(this).removeClass("ikTrgt_selected"); } else { var childrenToAdd = []; var pidsToAdd = []; $("#"+tmpId+">.ikSGBody").find(".ttRow").each(function() { var childId = $(this).attr("id"); if($(this).data("overlay")) { guiObj.infokOlMap.setOverlay(""+$(this).data("overlay"), true); } if($(this).data("ttype") != 0) { var trgtData = $("#"+$(this).data("parentid")).data("trgts")[childId]; var partId = trgtData["partid"] || null; $("."+childId, "#ikTTCont").addClass("ikTrgt_onMap"); $("."+childId, "#ikSearchResultCont").addClass("ikTrgt_onMap"); $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikSearchResultCont").addClass("ikTrgt_selected"); if($(this).data("ttype") >= 4) { var trgtData = $("#"+$("#"+childId).data("parentid")).data("trgts")[childId]; var tmpBbox = trgtData["bbox"]; var addrLoc = new OpenLayers.Bounds(tmpBbox[0],tmpBbox[1],tmpBbox[2],tmpBbox[3]).getCenterLonLat().transform(new OpenLayers.Projection("EPSG:2393"), guiObj.infokOlMap.map.getProjectionObject());//!!! Täällä on vakiona asetettu projektio! var addrStr = $("."+childId+">.ttRowTitle>.ikTrgtName").text(); var addrPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(addrLoc.lon, addrLoc.lat), {iksymbol: "RedBall18.gif", "ikdescription": addrStr, "objectid": ""+childId, "partid": ""+childId}); addrPoint.fid = ""+childId; guiObj.addrsOnMap[""+childId] = addrPoint; guiObj.infokOlMap.usrLayer.addFeatures([addrPoint]); } else { if(partId) { pidsToAdd.push([""+childId, ""+partId]) } else { childrenToAdd.push(""+childId); } guiObj.checkParents($("#"+childId)); if($(this).data("ttype") == 2)guiObj.setRoutes.push(""+childId); } } else if($("."+childId).find(".ttRowBody:parent").length == 0) { guiObj.loadTargets(childId); } else { $("."+childId+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+childId+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); } $("."+childId+">.ttRowTitle>.ikTrgt_select", "#ikTTCont").addClass("ikTrgt_selected"); }); if(childrenToAdd.length > 0) { guiObj.infokOlMap.addFeatures(childrenToAdd); } if(pidsToAdd.length > 0) { var parts = []; $(pidsToAdd).each(function() {parts.push(this[1]);}); guiObj.infokOlMap.addParts(parts); guiObj.infokOlMap.selPids(pidsToAdd); } if(guiObj.setRoutes.length > 0 && !guiObj.infokOlMap.rMeasCreated && !guiObj.infokOlMap.ikMeasureControl) guiObj.showRouteMeasureTool(true); $(this).addClass("ikTrgt_selected"); } return false; }); if(hasAddr) { for(var oid in guiObj.addrsOnMap) { if($.inArray(oid, addrNotToRem) == -1) { guiObj.infokOlMap.selectedTrgts = separateArray([oid], guiObj.infokOlMap.selectedTrgts); guiObj.infokOlMap.selectedParts = separateArray([oid], guiObj.infokOlMap.selectedParts); try { guiObj.infokOlMap.usrLayer.removeFeatures([guiObj.addrsOnMap[oid]]); delete guiObj.addrsOnMap[oid]; } catch(e) {} } } } } else { $(insertContainer).html(tmpContent.join("")); guiObj.waitingGroups = $.grep(guiObj.waitingGroups, function(gid) {return (parentId != gid);}); } $.merge(guiObj.trgtBuffer, trgtsToAdd); if(childrenToLoad.length == 0 && guiObj.waitingGroups.length == 0) { if(guiObj.trgtBuffer.length > 0) { guiObj.infokOlMap.addFeatures(guiObj.trgtBuffer); guiObj.trgtBuffer = []; if(guiObj.setRoutes.length > 0 && !guiObj.infokOlMap.rMeasCreated && !guiObj.infokOlMap.ikMeasureControl) guiObj.showRouteMeasureTool(true); } if(guiObj.isLoadingHash && ikHash && ikHash.selOids) { guiObj.loadingHash = false; $(ikHash.selOids).each(function() { guiObj.markSelected(this); }); } } else { $.merge(guiObj.waitingGroups, childrenToLoad); } $("#"+parentId).data("trgts", trgts); if(isSearch) { if(json != "null") { guiObj.adjustSearchCont("show"); $("#ikNoSearchResult").slideUp(); if(!guiObj.settings.oldMobile) { $("#ikSearchResultCont").slideDown("fast"); } else { $("#ikSearchResultCont").slideDown("fast", function() {$("#ikSearchResultCont").buttonscroller();}); } $(".ikSearchClosed").addClass("ikSearchOpen"); } else { $("#ikSearchResultCont").html(""); $("#ikSearchResultCont").slideUp("fast"); $("#ikNoSearchResult").slideDown("fast"); } } else { var tDoms = $(insertContainer+">.hasData"); if(tDoms.length > 20) { $(tDoms).slice(15).hide(); $(insertContainer).append("
Listaa kaikki kohteet
"); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[trgt_titles.']").localize("trgtslan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } } if(!$.isEmptyObject(guiObj.selectedSearch)) { for(var trgt in guiObj.selectedSearch) { var parents = guiObj.selectedSearch[trgt]; $(parents).each(function() { $("."+this+">.ttRowTitle>.ikTrgt_select").addClass("ikTrgt_some"); $("."+this+">.ttRowTitle>.ikTrgt_Noselect").addClass("ikTrgt_Nosome"); $("."+this+">.ttRowTitle>.ikTrgtName").addClass("ikHasSelectedTrgtsGroupTitle"); $("."+this+">.ttRowTitle>.ikClearGroup").addClass("ikXmarks"); }); $("."+trgt+">.ttRowTitle>.ikTrgt_select").addClass("ikTrgt_selected"); if($("."+trgt).data("ttype") != 0 && $.inArray(""+trgt, guiObj.infokOlMap.selectedTrgts) >= 0)$("."+trgt+">.ttRowTitle>.ikTrgtName").addClass("ikSelectedOnList"); } } } $(".ttRowBody", insertContainer).hide(); if(!parentSelected && !silent) $(insertContainer).slideDown(); if(parentId != "ikTTCont" && !parentSelected && !silent) { $("."+parentId+">.ttRowTitle>.ikGroupOpen").addClass("ikGroupClose"); $("."+parentId+">.ttRowTitle>.ikTrgtName").addClass("ikOpenGroupTitle"); } $(".ikLongListButton", insertContainer).bind("click", function() { $(this).siblings(".hasData").show(); $(this).remove(); return false; }); $(".ikTrgt_select", insertContainer).bind("click", function() { guiObj.checkTarget(this); return false; }); if(guiObj.settings.mobile) { $(".ikTrgtName", insertContainer).bind("click", function() { guiObj.selectTarget($(this).parents(".ttRowTitle")); return false; }); } else { $(".ikGroupOpen, .ikTrgtName", insertContainer).bind("click", function() { guiObj.selectTarget($(this).parents(".ttRowTitle")); return false; }); } try { if(!guiObj.settings.oldMobile) { $("#ikAllTrgtCont").unbind('.scrollbarPaper'); $("#ikAllTrgtCont").removeData('scrollbarPaper'); $("#ikAllTrgtCont").siblings(".scrollbarpaper-container").remove(); $("#ikAllTrgtCont").scrollbarPaper(); var greenScroll = $("#ikAllTrgtCont").siblings(".scrollbarpaper-container"); $(greenScroll).addClass("ikGbg"); $(".scrollbarpaper-track", greenScroll).addClass("ikGbg"); $(".scrollbarpaper-drag", greenScroll).addClass("ikGbg"); $(".scrollbarpaper-drag-top", greenScroll).addClass("ikGbg"); $(".scrollbarpaper-drag-bottom", greenScroll).addClass("ikGbg"); } else { $("#ikAllTrgtCont").buttonscroller(); } } catch(e){} if(isSearch) { $("#ikNoSearchResult").hide(); if(!guiObj.settings.oldMobile) { try { $("#ikSearchResultCont").unbind('.scrollbarPaper'); $("#ikSearchResultCont").removeData('scrollbarPaper'); $("#ikSearchResultCont").siblings(".scrollbarpaper-container").remove(); $("#ikSearchResultCont").scrollbarPaper(); } catch(e){} } else { $("#ikSearchResultCont").buttonscroller(); } } if(parentSelected) { guiObj.checkParents($("#"+parentId)); } else if (forParentChck.length > 0) { $(forParentChck).each(function() { guiObj.checkParents($("#"+parentId).children("#"+this)); }); } $(childrenToLoad).each(function() { guiObj.loadTargets(this, silent); }); } catch(err) { try{console.log(err);}catch(e){} $(insertContainer).html(""); if(isSearch) { $("#ikSearchResultCont").slideUp("fast", function() { $("#ikNoSearchResult").slideDown("fast"); $(".ikSearchClosed").addClass("ikSearchOpen"); guiObj.adjustSearchCont("show"); if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikAllTrgtCont").buttonscroller(); $("#ikSearchResultCont").buttonscroller(); } }); } else { $("#ikAllTrgtCont").css({height: ($(".ikMapGuiContainer").innerHeight()-$("#ikMapSelCont").outerHeight()-$("#ikSearchTitle").outerHeight()-$("#ikSearchBottomSpacer").outerHeight()-$("#ikAllTrgtBottomSpacer:visible").outerHeight()-12)+"px"}); if($(".ikMapGuiContainer").hasClass("igOldMobile")) { $("#ikAllTrgtCont").buttonscroller(); $("#ikSearchResultCont").buttonscroller(); } } } return true; }; function LoadTrgtInfo(trgtId, infoId, lonlat) { var guiObj = this; guiObj.infokOlMap.showLoad(true); var llStr = lonlat? "["+lonlat.lon+","+lonlat.lat+"]":null; $.ajax({ type: "POST", dataType: "html", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/infotext.php?customer=infogis-pvp&session=", async: true, data: "tid="+trgtId+"&pid="+infoId+"&lonlat="+llStr+"&proj="+guiObj.infokOlMap.map.getProjection()+"&lan="+ikLan+"&clientId="+ikClient, success: function(html) { guiObj.handleTrgtInfo(trgtId, infoId, html, guiObj); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.showInfoPanel(false); guiObj.infokOlMap.showLoad(false); return true; } }); return true; }; function HandleTrgtInfo(trgtId, infoId, html, guiObj) { $(".ikInfoBody").unbind('.scrollbarPaper'); $(".ikInfoBody").removeData('scrollbarPaper'); $(".ikInfoBody").siblings(".scrollbarpaper-container").remove(); if(html.length > 0) { var hasInfo = $(".ikInfoBody").html().length; if(guiObj.settings.altInfoPanel) { $("#"+guiObj.settings.altInfoPanel).html("
"+html+"
"); $("#ikAltInfoPanel").data({"trgtid": trgtId, "infoid": infoId}); $("#ikAltInfoPanel>.ikCloseCont").click(function() { guiObj.showInfoPanel(false); }); } else { $(".ikInfoBody").html(html); if(guiObj.settings.autoShowInfoPanel)guiObj.showInfoPanel(true); $("#ikInfoCont").data({"trgtid": trgtId, "infoid": infoId}); try { if(!guiObj.settings.oldMobile) { $(".ikInfoBody:visible").scrollbarPaper(); } else { $(".ikInfoBody:visible").buttonscroller(); } } catch(e){} } } else { guiObj.showInfoPanel(false); } return true; }; function LoadCounties() { var guiObj = this; guiObj.infokOlMap.showLoad(true); $.ajax({ type: "POST", dataType: "json", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/county.json.php?customer=infogis-pvp", async: true, data: "lan="+ikLan+"&clientId="+ikClient+"&selCounty="+guiObj.selCounty, success: function(json) { guiObj.handleCounties(json, guiObj); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.infokOlMap.showLoad(false); //alert(textStatus); return true; } }); return true; }; function HandleCounties(json, guiObj) { if(json["counties"].length > 0) { var selected = json["selected"]; var tmpHTML = ""; $(json["counties"]).each(function() { var value = this["value"]; var name = this["name"]; var tmplonlat = this["lonlat"]; var mapPref = this["mapPref"]; tmpHTML += "
Rajaa kohteita: "+name); } else if(selected == value) { tmpHTML += " selCounty"; guiObj.selCounty = value; $(".ikCGName").html("Rajaa kohteita: "+name); } tmpHTML += "'>
"+name+"
"; }); $("#ikCountyBody").html(tmpHTML); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $(".ikCountyRow").bind("click", function() { var selName = $(this).children(".ikCoTName").text(); $(".ikCGName").html("Rajaa kohteita: "+selName); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[base_titles.c_n_t]']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $("#ikCountyBody").slideUp(); $(".ikCoTOpen").removeClass("ikCoTOpen"); $(".ikGroupOnList").removeClass("ikOpenGroupTitle"); $(this).siblings().removeClass("selCounty"); $(this).addClass("selCounty"); guiObj.selCounty = ""+$(this).data("countyval"); guiObj.selectCounty(this); return true; }); } return true; }; function LoadThemes() { var guiObj = this; guiObj.infokOlMap.showLoad(true); $.ajax({ type: "POST", dataType: "json", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/theme.json.php?customer=infogis-pvp", async: true, data: "lan="+ikLan+"&clientId="+ikClient, success: function(json) { guiObj.handleThemes(json, guiObj); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.infokOlMap.showLoad(false); //alert(textStatus); return true; } }); return true; }; function HandleThemes(json, guiObj) { if(json["themes"].length > 0) { var selected = json["selected"]; var tmpHTML = ""; $(json["themes"]).each(function() { var value = this["value"]; var name = this["name"]; var mapPref = this["mapPref"]; var tmplonlat = this["lonlat"]; tmpHTML += "
Rajaa kohteita: "+name); } else if(selected == value) { tmpHTML += " selTheme"; guiObj.selTheme = value; $(".ikTGName").html("Rajaa kohteita: "+name); } tmpHTML += "'>
"+name+"
"; }); $("#ikThemeBody").html(tmpHTML); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $(".ikThemeRow").bind("click", function() { var selName = $(this).children(".ikCoTName").text(); $(".ikTGName").html("Rajaa kohteita: "+selName); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[base_titles.c_n_t]']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } $("#ikThemeBody").slideUp(); $(".ikCoTOpen").removeClass("ikCoTOpen"); $(".ikGroupOnList").removeClass("ikOpenGroupTitle"); $(this).siblings().removeClass("selTheme"); $(this).addClass("selTheme"); guiObj.selTheme = ""+$(this).data("themeval"); guiObj.selectTheme(this); return true; }); } return true; }; function LoadTinyUrl(cookieLink) { var guiObj = this; guiObj.infokOlMap.showLoad(true); $.ajax({ type: "POST", dataType: "text", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/createlink.php?customer=infogis-pvp", async: true, data: guiObj.createHashLink(), success: function(text) { guiObj.handleTinyUrl(text, guiObj, cookieLink); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.infokOlMap.showLoad(false); //alert(errorThrown); return true; } }); return true; }; function HandleTinyUrl(text, guiObj, cookieLink) { if(!cookieLink) { $("#ikMapLink").html(text); if($("#ikSomeButtonsCont").html().length > 0) $("#ikSomeButtonsCont").html(""); if(guiObj.settings.socialNetworks && guiObj.settings.socialNetworks.length > 0) { var descr = ""; if($("#ikLinkText:visible").length > 0 && $("#ikLinkText:visible").val().length > 0 && $("#ikLinkText").val() != $("#ikLinkText").attr("placeholder")) { descr = encodeURI($("#ikLinkText").val()+""); } else if($("#ikInfoCont:visible") && $(".ikInfoBody").html().length > 0) { descr = encodeURI($(".ikInfoBody").text()+""); } $("#ikSomeButtonsCont").share({ networks: guiObj.settings.socialNetworks, theme: 'square', description: descr, urlToShare: text }); } } else { guiObj.createSaveLinkView(text); if(ikLan != "fi" || forceLocal) { $("*[rel^='localize[save_view']").localize("linklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); } } return true; }; function LoadHelp() { var guiObj = this; guiObj.infokOlMap.showLoad(true); var fromInit = false; if(!this.welcomeShown && this.settings.showHelp == V_SHOWN) { this.welcomeVisible = true; fromInit = true; $("#ikWelcomeTitle").show(); $("#ikHelpTitle").hide(); } else { $("#ikWelcomeTitle").hide(); $("#ikHelpTitle").show(); } this.welcomeShown = true; $.ajax({ type: "POST", dataType: "html", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/help.php?customer=infogis-pvp", async: true, data: "lan="+ikLan+"&clientId="+ikClient+"&fromInit="+fromInit, success: function(html) { guiObj.handleHelp(html, guiObj); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.infokOlMap.showLoad(false); //alert(errorThrown); return true; } }); return true; }; function HandleHelp(html, guiObj) { var hasHelp = $(".ikHelpBody").html().length; $(".ikHelpBody").unbind('.scrollbarPaper'); $(".ikHelpBody").removeData('scrollbarPaper'); $(".ikHelpBody").siblings(".scrollbarpaper-container").remove(); if(html.length > 0) { $(".ikHelpBody").html(html); guiObj.showHelpPanel(true); try { $(".ikHelpBody").scrollbarPaper(); } catch(e){} } return true; }; function SubmitFeedback() { var guiObj = this; guiObj.infokOlMap.showLoad(true); var county = ($(".selCounty") && $(".selCounty").data("countyval"))?$(".selCounty").data("countyval"):null; var usrPoint = (this.infokOlMap.pointCtrl && this.infokOlMap.pointCtrl.lastPoint)? this.infokOlMap.pointCtrl.lastPoint.geometry : null; var usrPStr = usrPoint? "["+usrPoint.x+","+usrPoint.y+"]":"[]"; $.ajax({ type: "POST", dataType: "text", timeout: 15000, url: "https://kartta.jict.fi/infogis-pvp/php/feedback.php?customer=infogis-pvp", async: true, data: guiObj.createHashLink(true), success: function(text) { $("#feedbackSubmit").hide(); $("#ikFeedback_fail").hide(); $("#ikFeedback_success").show(); guiObj.infokOlMap.showLoad(false); }, error: function (XMLHttpRequest, textStatus, errorThrown) { guiObj.infokOlMap.showLoad(false); $("#ikFeedback_success").hide(); $("#ikFeedback_fail").show(); return true; } }); return true; }; function ChangeLanguage(lan) { if(lan != ikLan) { ikLan = lan; this.showInfoPanel(false); $("#ikNoSearchResult").hide(); $(".ikSearchClosed").removeClass("ikSearchOpen"); if($("#ikSearchResultCont").html().length > 0) { $("#ikSearchResultCont").html(""); $("#ikSearchResultCont").slideUp(); this.adjustSearchCont("hide"); } this.infokOlMap.remAllFeatures(); if(ikHash) { this.selCounty = ikHash.selCounty; this.selTheme = ikHash.selTheme; this.isLoadingHash = true; this.selectedSearch = ikHash.oidsOnMap; this.hashGroups = ikHash.openGroups; }/* if(ikHash) { this.selCounty = ikHash.selCounty; this.selTheme = ikHash.selTheme; this.selectedSearch = ikHash.oidsOnMap; }*/ this.loadCounties(); this.loadThemes(); this.loadTargets(null); if(ikHash) { if(ikHash.selMap)this.selectMap(ikHash.selMap, true); this.infokOlMap.map.moveTo(new OpenLayers.LonLat(ikHash.mapCenter[0], ikHash.mapCenter[1]) , ikHash.mapZoom); if(ikHash.usrPoint) { this.uPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ikHash.usrPoint[0], ikHash.usrPoint[1]), {iksymbol: "RedBall18.gif", "ikdescription-fi": "Linkitetty kohde", "ikdescription-en": "Linked target", objectid: "usrTrgt_1", partid: "usrTrgt_1"}); this.uPoint.fid = "usrTrgt_1"; this.infokOlMap.usrLayer.addFeatures([this.uPoint]); this.infokOlMap.ikTrgtCtrl.select(this.uPoint); this.showUsrTrgtMessage(); } else if(ikHash.infoPanel){ this.loadTrgtInfo(ikHash.infoPanel[0], ikHash.infoPanel[1]); } var oids = []; for(var oid in ikHash.oidsOnMap) { oids.push(""+oid); } var pids = ikHash.pidsOnMap; var oids_n_pids = [oids, pids]; this.mapInitCounter = 201; this.mapInitTimerId = window.setTimeout( OpenLayers.Function.bind(this.addHashSelection, this, oids_n_pids), 500 ); }/* if(ikHash) { if(ikHash.selMap)this.selectMap(ikHash.selMap, true); this.infokOlMap.map.moveTo(new OpenLayers.LonLat(ikHash.mapCenter[0], ikHash.mapCenter[1]) , ikHash.mapZoom); if(ikHash.usrPoint) { this.uPoint = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ikHash.usrPoint[0], ikHash.usrPoint[1]), {iksymbol: "RedBall18.gif", "ikdescription-fi": "Linkitetty kohde", "ikdescription-en": "Linked target", objectid: "usrTrgt_1", partid: "usrTrgt_1"}); this.uPoint.fid = "usrTrgt_1"; this.infokOlMap.usrLayer.addFeatures([this.uPoint]); this.showUsrTrgtMessage(); } else if(ikHash.infoPanel){ this.loadTrgtInfo(ikHash.infoPanel[0], ikHash.infoPanel[1]); } var oids = []; for(oid in ikHash.oidsOnMap) { oids.push(oid); } this.mapInitCounter = 201; this.mapInitTimerId = window.setTimeout( OpenLayers.Function.bind(this.addHashSelection, this, oids), 500 ); }*/ else if($(".ikHelpBody").html().length != 0) { $(".ikHelpBody").html(""); this.welcomeShown = false; this.loadHelp(); } $("*[rel^='localize']").localize("maplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("searchlan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("rplan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("linklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("feedbacklan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("trgtslan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $("*[rel^='localize']").localize("coordlistlan", {language: ikLan, pathPrefix:ikLocalisePrefix}); $(".ikMapRow").each(function() { var newName = ikMaps[$(this).data("mname")]["mName-"+ikLan] || false; if(newName) $(this).children(".ikMapName").html(newName); }); $("#ikMapSelection").html(""+$(".selMap").text()); try{ var datePickLocal = ikLan == "en"? "":ikLan; $.datepicker.setDefaults( $.datepicker.regional[ datePickLocal ] ); } catch(e){} } }; function GetCookieLinks() { var linkArr = []; var c_name = "ik_link-"+"infogis-pvp"; var c_value = document.cookie; var c_start = c_value.indexOf(" " + c_name + "="); if (c_start == -1) { c_start = c_value.indexOf(c_name + "="); } if (c_start == -1) { linkArr = null; } else { c_start = c_value.indexOf("=", c_start) + 1; var c_end = c_value.indexOf(";", c_start); if (c_end == -1) { c_end = c_value.length; } c_value = c_value.substring(c_start,c_end); var l_start = 0; do { var l_end = c_value.indexOf("|", l_start); if(l_end == -1) l_end = c_value.length; var link = c_value.substring(l_start,l_end); linkArr.push(link);//c_value.substring(l_start,l_end) l_start = l_end + 1; } while(l_end != c_value.length); } return linkArr; }; function DeleteCookieLink(link) { var links = this.getCookieLinks(); if(links && links.length > 0) { links = $.grep(links, function(l) {return (l != link);}); if(links && links.length > 0) { var cStr = links.join("|"); document.cookie= "ik_link-"+"infogis-pvp=" + cStr + "; expires=Fri, 31 Dec 9999 23:59:59 GMT"; } else { document.cookie= "ik_link-"+"infogis-pvp=; expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } };