Skip to content

Commit 0e0a523

Browse files
committed
Adjust to fcoo-application v18. A large part of the code used to create an application has been moved to fcoo--application v18
1 parent c2ab7de commit 0e0a523

8 files changed

+1097
-1383
lines changed

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fcoo-maps",
3-
"version": "1.33.0",
3+
"version": "1.34.0",
44
"homepage": "https://github.com/fcoo/fcoo-maps",
55
"authors": [
66
"Niels Holt"
@@ -26,7 +26,7 @@
2626
"es6"
2727
],
2828
"dependencies": {
29-
"fcoo-application": "fcoo/fcoo-application#^17.0.0",
29+
"fcoo-application": "fcoo/fcoo-application#^18.0.0",
3030
"fcoo-maps-colors": "fcoo/fcoo-maps-colors#latest",
3131
"leaflet-map-sync": "fcoo/leaflet-map-sync#^2.4.0",
3232
"leaflet-multi-maps": "fcoo/leaflet-multi-maps#^2.0.0",

demo/bower_components.js

+680-20
Large diffs are not rendered by default.

demo/index.html

+93-101
Original file line numberDiff line numberDiff line change
@@ -113,120 +113,112 @@
113113
window.fcoo.map.mainMapOptions.bsToggleBottomMenuControl = true;
114114

115115

116-
window.fcoo.map.createApplication(
116+
window.fcoo.map.createApplication({
117117
//options
118-
{
119-
120-
applicationName: {da:'fcoo-maps - Overskriften', en:'fcoo-maps - The Header'},
118+
applicationName: {da:'fcoo-maps - Overskriften', en:'fcoo-maps - The Header'},
121119
//*
122-
_multiMaps: false,
123-
multiMaps: {
124-
enabled : true,
125-
maxMaps : 5,
126-
maxZoomOffset: 2
127-
},
128-
129-
_multiMaps: {
130-
enabled : {mobile:false, tablet:true, desktop:true},
131-
maxMaps : {mobile:2, tablet:3, desktop:5},
132-
maxZoomOffset : 2
133-
},
134-
120+
_multiMaps: false,
121+
multiMaps: {
122+
enabled : true,
123+
maxMaps : 5,
124+
maxZoomOffset: 2
125+
},
135126

127+
_multiMaps: {
128+
enabled : {mobile:false, tablet:true, desktop:true},
129+
maxMaps : {mobile:2, tablet:3, desktop:5},
130+
maxZoomOffset : 2
131+
},
136132
//*/
137-
topMenu: {
138-
messages : "data/ifm-maps-info.json", //null or STRING or {subDir:STRING, fileName:STRING}
139-
},
133+
topMenu: {
134+
messages : "data/ifm-maps-info.json", //null or STRING or {subDir:STRING, fileName:STRING}
135+
},
140136

141-
leftMenu: {
142-
isLayerMenu: true,
143-
buttons: {
144-
bookmark: true,
145-
share : true,
146-
load : true,
147-
save : true,
148-
reset : true,
149-
setting : true
150-
},
137+
leftMenu: {
138+
buttons: {
139+
bookmark: true,
140+
share : true,
141+
load : true,
142+
save : true,
143+
reset : true,
144+
setting : true
151145
},
146+
},
152147

153-
_rightMenu: {
154-
content: [{icon:'fa-home', text:{da:'Dette er content', en:'This is content'}},{icon:'fa-car', text:{da:'Dette er content2', en:'This is content2'}}],
155-
_data: ['item1', 'item2'],
156-
_resolve: function(data, $container){}
157-
},
158-
_keepRightMenuButton: true,
159-
160-
bottomMenu: { //Just DEMO
161-
height : 120,
162-
handleWidth: 200,
163-
handleHeight: 26,
164-
isOpen: true,
165-
//handleClassName: 'testHandle',
166-
toggleOnHandleClick: true,
167-
hideHandleWhenOpen: true,
168-
content: [{icon:'fa-home', text:{da:'Dette er content', en:'This is content'}},{icon:'fa-car', text:{da:'Dette er content2', en:'This is content2'}}],
169-
},
148+
_rightMenu: {
149+
content: [{icon:'fa-home', text:{da:'Dette er content', en:'This is content'}},{icon:'fa-car', text:{da:'Dette er content2', en:'This is content2'}}],
150+
_data: ['item1', 'item2'],
151+
_resolve: function(data, $container){}
152+
},
153+
_keepRightMenuButton: true,
154+
155+
bottomMenu: { //Just DEMO
156+
height : 120,
157+
handleWidth: 200,
158+
handleHeight: 26,
159+
isOpen: true,
160+
//handleClassName: 'testHandle',
161+
toggleOnHandleClick: true,
162+
hideHandleWhenOpen: true,
163+
content: [{icon:'fa-home', text:{da:'Dette er content', en:'This is content'}},{icon:'fa-car', text:{da:'Dette er content2', en:'This is content2'}}],
164+
},
170165

171-
_other: [{
172-
data:{text:'Davs med dig'},
173-
resolve: function(data){
174-
console.log('other:'+data.text);
175-
},
176-
reload:1
177-
}],
178-
179-
colorInfo: {
180-
icon : 'fa-map', // //If the MapLayer also have a legend the icon from the legend is used
181-
text : 'Only land', //STRING //If the MapLayer also have a legend the text from the legend is used
182-
// HER> onlyLand : true, //Only show when cursor/map center is over land. Default = false
183-
// HER> onlyWater: false, //Only show when cursor/map center is over water/sea. Default = false
184-
show : true, //Turn the update on/off. Default = true
185-
186-
// HER> getColor : function(options) //Return the color (hex) to use as background-color in the infoBox.
187-
//options = {colorRGBA, colorHex, latLng}
188-
//Default = return options.colorHex
189-
//Set to false if no background-color in the infoBox is needed
190-
// HER> allowTransparentColor: BOOLEAN //If true getColor is also called on fully transparent colors
191-
192-
// HER> getText : function(options) //Return the content (STRING or {da:STRING, en:STRING} or {icon, text}) to be displayed in the infoBox.
166+
_other: [{
167+
data:{text:'Davs med dig'},
168+
resolve: function(data){
169+
console.log('other:'+data.text);
170+
},
171+
reload:1
172+
}],
173+
174+
colorInfo: {
175+
icon : 'fa-map', // //If the MapLayer also have a legend the icon from the legend is used
176+
text : 'Only land', //STRING //If the MapLayer also have a legend the text from the legend is used
177+
// HER> onlyLand : true, //Only show when cursor/map center is over land. Default = false
178+
// HER> onlyWater: false, //Only show when cursor/map center is over water/sea. Default = false
179+
show : true, //Turn the update on/off. Default = true
180+
181+
// HER> getColor : function(options) //Return the color (hex) to use as background-color in the infoBox.
182+
//options = {colorRGBA, colorHex, latLng}
183+
//Default = return options.colorHex
184+
//Set to false if no background-color in the infoBox is needed
185+
// HER> allowTransparentColor: BOOLEAN //If true getColor is also called on fully transparent colors
186+
187+
// HER> getText : function(options) //Return the content (STRING or {da:STRING, en:STRING} or {icon, text}) to be displayed in the infoBox.
193188
//options = {colorRGBA, colorHex, transparent, color (from getColor), latLng}
194189
//Default: return ""
195-
},
196-
197-
198-
199-
finally: function(){
200-
201-
//HER setTimeout(function(){
202-
//HER fcoo.map.time.setCurrentRelative(300);
203-
//HER }, 3000);
204-
205-
//HER setTimeout(function(){
206-
//HER fcoo.map.time.setCurrentRelative(-13);
207-
//HER }, 10000);
208-
209-
return;
210-
if (!fcoo.map.MapLayer_Time) return;
190+
},
211191

212-
fcoo.map._addMapLayer('DETTE_ER_EN_TEST', fcoo.map.MapLayer_Time, {
213-
text:' Dette er en test', icon: 'fa-clock',
214-
layerOptions: {
215-
dataset: 'DMI/HARMONIE/DMI_NEA_MAPS_v005C.nc',
216-
layers : 'windspeed', //'UGRD:VGRD',
217-
styles : {
218-
plot_method: 'contourf',
219-
legend: 'Wind_ms_BGYRP_11colors_1.1'
220-
}
192+
finally: function(){
193+
//HER setTimeout(function(){
194+
//HER fcoo.map.time.setCurrentRelative(300);
195+
//HER }, 3000);
196+
197+
//HER setTimeout(function(){
198+
//HER fcoo.map.time.setCurrentRelative(-13);
199+
//HER }, 10000);
200+
201+
return;
202+
if (!fcoo.map.MapLayer_Time) return;
203+
204+
fcoo.map._addMapLayer('DETTE_ER_EN_TEST', fcoo.map.MapLayer_Time, {
205+
text:' Dette er en test', icon: 'fa-clock',
206+
layerOptions: {
207+
dataset: 'DMI/HARMONIE/DMI_NEA_MAPS_v005C.nc',
208+
layers : 'windspeed', //'UGRD:VGRD',
209+
styles : {
210+
plot_method: 'contourf',
211+
legend: 'Wind_ms_BGYRP_11colors_1.1'
221212
}
222-
})
223-
.addTo([0,1])
224-
//HER .workingOn(0);
225-
//.selectMaps();
226-
}
227-
},
213+
}
214+
})
215+
.addTo([0,1])
216+
//HER .workingOn(0);
217+
//.selectMaps();
218+
}
219+
},
228220

229-
//Default menu-layer
221+
//Default menu-layer
230222

231223
); //end of window.fcoo.map.createApplication
232224

0 commit comments

Comments
 (0)