Skip to content

Commit

Permalink
Add projection label in map/config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed Feb 25, 2014
1 parent 3fd8e11 commit 76a194d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
Expand Up @@ -49,7 +49,7 @@
list: gnMap.getMapConfig().projectionList,
md: 'EPSG:4326',
map: gnMap.getMapConfig().projection,
form: gnMap.getMapConfig().projectionList[0]
form: gnMap.getMapConfig().projectionList[0].code
};

scope.extent = {
Expand Down
Expand Up @@ -12,7 +12,13 @@
var defaultMapConfig = {
'useOSM': 'true',
'projection': 'EPSG:3857',
'projectionList': ['EPSG:4326', 'EPSG:3857']
'projectionList': [{
"code":"EPSG:4326",
"label":"WGS84 (EPSG:4326)"
},{
"code":"EPSG:3857",
"label":"Google mercator (EPSG:3857)"
}]
};
return {

Expand Down Expand Up @@ -49,7 +55,7 @@
},

getMapConfig: function() {
if (gnConfig['map.config'] && gnConfig['map.config'].length > 0) {
if (gnConfig['map.config'] && angular.isObject(gnConfig['map.config'])) {
return gnConfig['map.config'];
} else {
return defaultMapConfig;
Expand Down
Expand Up @@ -4,15 +4,16 @@

<!-- Header with projection selection, draw button and area list -->
<form class="form-inline" role="form">
<button class="btn btn-warning" data-ng-click="drawMap()">
<button class="btn btn-warning" data-ng-click="drawMap()"
data-ng-class="{active : drawing}">
<i class="fa fa-pencil"></i>&nbsp;<span data-translate="">drawRectangle</span>
</button>
<div class="col-sm-3">
<div class="col-sm-4">
<label class="sr-only" data-translate="">chooseProjection</label>
<select data-ng-model="projs.form">
<option data-ng-repeat="proj in projs.list"
value="{{proj}}"
data-ng-selected="proj == projs.form">{{proj}}
value="{{proj.code}}"
data-ng-selected="proj.code == projs.form">{{proj.label}}
</option>
</select>
</div>
Expand All @@ -24,11 +25,11 @@

<!-- Hidden field that match xml metadata schema -->
<div class="hidden">
<input data-ng-model="extent.form[0]" type="" name="{{hleftRef}}"/>
<input data-ng-model="extent.form[1]" type="" name="{{hbottomRef}}"/>
<input data-ng-model="extent.form[2]" type="" name="{{hrightRef}}"/>
<input data-ng-model="extent.form[3]" type="" name="{{htopRef}}"/>
<input data-ng-model="dcExtent" type="" name="{{dcRef}}"/>
<input data-ng-model="extent.form[0]" name="{{hleftRef}}"/>
<input data-ng-model="extent.form[1]" name="{{hbottomRef}}"/>
<input data-ng-model="extent.form[2]" name="{{hrightRef}}"/>
<input data-ng-model="extent.form[3]" name="{{htopRef}}"/>
<input data-ng-model="dcExtent" name="{{dcRef}}"/>
</div>
<table class="text-center">
<tr align="center">
Expand Down
Expand Up @@ -640,7 +640,8 @@ INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system
-- INSERT INTO Settings (name, value, datatype, position, internal) VALUES
-- ('map/backgroundChoices', '{"contextList": []}', 0, 9590, false);
INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('map/config', '{"useOSM":false,"context":"","layer":{"url":"http://www2.demis.nl/mapserver/wms.asp?","layers":"Countries","version":"1.1.1"},"projection":"EPSG:4326","projectionList":["EPSG:4326","EPSG:3857"]}', 0, 9590, 'n');
('map/config', '{"useOSM":true,"context":"","layer":{"url":"http://www2.demis.nl/mapserver/wms.asp?","layers":"Countries","version":"1.1.1"},"projection":"EPSG:3857","projectionList":[{"code":"EPSG:4326","label":"WGS84 (EPSG:4326)"},{"code":"EPSG:3857","label":"Google mercator (EPSG:3857)"}]}', 0, 9590, 'n');

INSERT INTO Settings (name, value, datatype, position, internal) VALUES
('metadata/editor/schemaConfig', '{"iso19110":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"readonly":true,"categories":["dataset"]},"validation":{"display":true}},"iso19139":{"defaultTab":"default","displayToolTip":false,"related":{"display":true,"categories":[]},"suggestion":{"display":true},"validation":{"display":true}},"dublin-core":{"defaultTab":"default","related":{"display":true,"readonly":true,"categories":[]},}}', 0, 10000, 'n');

Expand Down

0 comments on commit 76a194d

Please sign in to comment.