Fullstack Portal Created by the HCMR for the Marine Strategy Framework Directive Program in order to cover demands and aspects considering extendability and maintainability
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.2 KiB

2 years ago
/**
* Created by simeon on 11/14/2016.
*/
function init_configuration() {
// Hide Language button
var maptab_toolbar_navigation_tab = Ext.getCmp('maptab_toolbar_navigation_tab');
maptab_toolbar_navigation_tab.child('#languageBtn').hide();
// Expand Basemap tree
// maptab_west_layer_tree_panel_tree_json_store.getNodeById('maptab_west_layer_tree_panel_tabs_layers_basemaps_node').expand();
// Set active Basemap
/*maptab_west_layer_tree_panel_tree_json_store.getNodeById('maptab_west_layer_tree_panel_tabs_layers_basemaps_node').eachChild(function (node) {
if (node.isLeaf()) {
if (node.data.text === 'Google Satellite') {
maptab_west_layer_check_node(node, true);
}
}
});*/
//Overviewmap
var overviewmap = document.querySelectorAll(".olControlOverviewMapElement");
for (var i = 0; i < overviewmap.length; i++) {
overviewmap[i].style.backgroundColor = '#D0D0D0';
}
// Hide Metadata tab
// var viewport_center = Ext.getCmp('viewport_center');
// viewport_center.child('#viewport_metadatatab').tab.hide();
// Set Search tab active
Ext.getCmp('maptab_north_tabpanel').setActiveTab('maptab_toolbar_search_tab');
// Toogle Point Info tool
// Ext.getCmp('maptab_toolbar_general_featureInfo').toggle(true);
// Hide Add/Revome Layer buttons
// Ext.getCmp('maptab_west_layer_tree_panel_add_btn').hide();
// Ext.getCmp('maptab_west_layer_tree_panel_remove_btn').hide();
// Set Legend accordion expand
//setTimeout(function () {
// Ext.getCmp('legendPanelID').expand();
//}, 2000);
//Swipe
// Ext.getCmp('swipebutton').toggle(true);
// Ext.getCmp('swipe_choose_layero').setValue('Vegetation Index - NDVI');
// Ext.getCmp('swipe_choose_layero').setRawValue('Vegetation Index - NDVI');
// swipe_layer = mapFindLayerById('334a903a5e49d0b125ed03eda17f8690192be778e6ba632dd0eeb35591dd5429').clone();
// map.addLayers([swipe_layer]);
// swipe.activate();
// Set Search tab active from url parameter
try{
var tab = fn_getParameterByName("tab");
Ext.getCmp('viewport_center').setActiveTab(tab);
}catch (e) {
}
//Zoom to point
if(fn_getParameterByName("lon") !== '' && fn_getParameterByName("lat") !== '' && fn_getParameterByName("zoom") !== ''){
var point = new OpenLayers.Geometry.Point(Number(fn_getParameterByName("lon")), Number(fn_getParameterByName("lat")));
var converted = point.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
mapSetCenter(converted.x,converted.y,Number(fn_getParameterByName("zoom")));
}
map.events.on({
"moveend":function()
{
try {
var converted = map.getCenter().transform(map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326"));
fn_setUrlParameter(location.href, 'lon', converted.lon);
fn_setUrlParameter(location.href, 'lat', converted.lat);
fn_setUrlParameter(location.href, 'zoom', map.getZoom());
}catch (e) {}
}
});
}
init_onload_fn.push(init_configuration);