Skip to content

Commit

Permalink
Fix crs list
Browse files Browse the repository at this point in the history
  • Loading branch information
uprel committed Sep 12, 2019
1 parent 527445a commit 8ecf80c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/site/js/GUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ MyViewportUi = Ext.extend(Ext.Viewport, {
//value: projectData.crsComboStore()[0][1],
listeners: {
"select": function(combo, record, index) {
Eqwc.currentMapProjection = projectData.getProjectionsList(record.data.code);
Eqwc.currentMapProjection = projectData.getProjectionsList(record.data.code)[0];
}
//"render": function(c) {
// new Ext.ToolTip({
Expand Down
2 changes: 1 addition & 1 deletion client/site/js/LoadAppProjectData.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ projectData.getProjectionsList = function(code) {
}
}

return ret.length == 1 ? ret[0] : ret;
return ret;
};

projectData.crsComboStore = function() {
Expand Down
6 changes: 3 additions & 3 deletions client/site/js/WebgisInit_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,14 @@ function postLoading() {
//initial CRS to display coordinates. Take setting if exists or first item crsComboStore which is QGIS project CRS.
var value = this.data.itemAt(0).data.code;
if(projectData.defaultCoordinatesCrsCode) {
var test = projectData.getProjectionsList('EPSG:'+projectData.defaultCoordinatesCrsCode);
if(test.length>0) {
var test = projectData.getProjectionsList('EPSG:'+projectData.defaultCoordinatesCrsCode)[0];
if(test && test.length>0) {
value = test[0];
}
}

rightStatusText.setValue(value);
Eqwc.currentMapProjection = projectData.getProjectionsList(value);
Eqwc.currentMapProjection = projectData.getProjectionsList(value)[0];
});
rightStatusText.store.loadData(projectData.crsComboStore());

Expand Down
7 changes: 7 additions & 0 deletions client_common/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,12 @@
}
};

//put crs into crs_list if it doesn't exist
if(projectData.crs_list.indexOf(projectData.crs) == -1)
{
projectData.crs_list.unshift(projectData.crs);
}


//TODO use in css!
var userLogoImg = projectData.gis_projects.path + 'admin/resources/images/user_gray.png';

0 comments on commit 8ecf80c

Please sign in to comment.