Commit 4ad4d1b1 authored by Niels Holt's avatar Niels Holt

Merge branch 'release/3.0.0'

parents b5b0d392 84a23cd9
......@@ -26,26 +26,32 @@ CONTACT : info@fcoo.dk
<link href="{CSS_FILE_NAME}" rel="stylesheet">
</head>
<body>
<body class="loading">
<div class="loading"></div>
<div id="map"></div>
<script type="text/javascript" src="{JS_FILE_NAME}"></script>
<!-- Piwik -->
<!--
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.fcoo.dk/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
var _paq = _paq || [];
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.fcoo.dk/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//analytics.fcoo.dk/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<noscript>
<p><img src="//analytics.fcoo.dk/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p>
</noscript>
-->
<!-- End Piwik Code -->
</body>
......
(function (L /*, window, document, undefined*/) {
"use strict";
L.Control.FcooLocate = L.Control.Locate.extend({
start: function() {
L.Control.Locate.prototype.start.call(this);
this._map.fire('startlocator', this);
},
stop: function() {
L.Control.Locate.prototype.stop.call(this);
this._map.fire('stoplocator', this);
}
});
}(L, this, document));
\ No newline at end of file
(function (L /*, window, document, undefined*/){
"use strict";
L.Control.Permalink.include({
initialize_locate: function() {
this.on('add', this._onadd_locate, this);
},
_onadd_locate: function() {
this._map.on('startfollowing', this._start_following, this);
this._map.on('stopfollowing', this._stop_following, this);
this._map.on('startlocator', this._start_locator, this);
this._map.on('stoplocator', this._stop_locator, this);
this._update_locate();
},
_update_locate: function() {
if (!this.options.locator) return;
var options = this.options.locator.getState();
if (options) {
this._update(options);
}
},
_start_locator: function(/*e*/) {
this._update({locate: "true"});
},
_stop_locator: function(e) {
this._update({
locate: "false",
follow: "true"
});
// We want the locator to start with following on if enabled again
if (e.options.follow === false) {
e.options.follow = true;
}
},
_start_following: function() {
this._update({follow: "true"});
},
_stop_following: function() {
this._update({follow: "false"});
}
});
//L.Control.Layers.include({
L.Control.Locate.include({
getState: function() {
var options = {
locate: String(this._active),
follow: String(this._following)
};
return options;
}
});
})(L, this, document);
......@@ -20,11 +20,11 @@
'fcoo-name' : 'Defence Centre for Operational Oceanography',
'ifm-name' : 'Marine Forecast',
'domain-denmark' : 'Denmark',
'domain-greenland' : 'Greenland',
'domain-faroe_islands': 'Faroe Islands',
'domain-mediterranean': 'Mediterranean',
'domain-indian_ocean' : 'Indian Ocean',
'domain-denmark' : 'Denmark',
'domain-greenland' : 'Greenland',
'domain-faroe_islands' : 'Faroe Islands',
'domain-mediterranean' : 'Mediterranean',
'domain-indian_ocean' : 'Indian Ocean',
maps: 'Maps',
layers: 'Layers',
......
......@@ -211,10 +211,6 @@
if (mediaQueriesSupported()) {
var mq = window.matchMedia('screen and (orientation: landscape) and (min-width: 641px) and (min-height: 481px), screen and (orientation: portrait) and (min-width: 481px) and (min-height: 641px)');
desktop = mq.matches;
// Special handling of IE8 and below
if (window.isIE8) {
desktop = true;
}
}
//Setting title of document
......@@ -337,25 +333,22 @@
$(mapStore.controls.mousePosition._container).addClass("hide-on-print");
$(mapStore.controls.mousePosition._container).addClass("show-on-large");
*/
// We do not support these on IE8
if (!window.isIE8) {
// Only supported over https for security reasons
if (window.location.protocol === "https:") {
// Add locator control
map.addControl(mapStore.controls.locate);
$(mapStore.controls.locate._container).addClass("hide-for-print");
// Enable geolocation if locate query string parameter is true
if (urlParams.locate === "true") {
mapStore.controls.locate.start();
}
// Only supported over https for security reasons
if (window.location.protocol === "https:") {
// Add locator control
map.addControl(mapStore.controls.locate);
$(mapStore.controls.locate._container).addClass("hide-for-print");
// Enable geolocation if locate query string parameter is true
if (urlParams.locate === "true") {
mapStore.controls.locate.start();
}
// Add geocoder control
map.addControl(mapStore.controls.OSMGeocoder);
$(mapStore.controls.OSMGeocoder._container).addClass("hide-for-print show-for-large-up");
}
// Add geocoder control
map.addControl(mapStore.controls.OSMGeocoder);
$(mapStore.controls.OSMGeocoder._container).addClass("hide-for-print show-for-large-up");
/*
// Add length scale control
map.addControl(mapStore.controls.doubleScale);
......@@ -412,7 +405,7 @@
var datetimeControl;
// We use the new time slider for desktop and the old
// one for mobile. This is a temporary solution.
if (desktop && !window.isIE8) {
if (desktop) {
datetimeControl = new L.Control.TimeSlider({
lang: localLang,
position: datetime_pos,
......@@ -549,10 +542,6 @@
if (mediaQueriesSupported()) {
mq.addListener(function (){
var desktop = mq.matches;
// Special handling of IE8 and below
if (window.isIE8) {
desktop = true;
}
// Modify layer control
// Disabled since the control is not really designed
......@@ -667,10 +656,6 @@
if (mediaQueriesSupported()) {
var mq = window.matchMedia('screen and (orientation: landscape) and (min-width: 641px) and (min-height: 481px), screen and (orientation: portrait) and (min-width: 481px) and (min-height: 641px)');
desktop = mq.matches;
// Special handling of IE8 and below
if (window.isIE8) {
desktop = true;
}
}
controls = {};
......@@ -705,7 +690,7 @@
// Remove Solar Terminator from overlays if on small units
// to save battery + does not work on all mobiles
if ((window.isIE8 || !desktop) && overlays.hasOwnProperty("Celestial information")) {
if (!desktop && overlays.hasOwnProperty("Celestial information")) {
delete overlays["Celestial information"];
}
......@@ -813,19 +798,28 @@
if (urlParams.follow === "false") {
follow = false;
}
controls.locate = new L.Control.FcooLocate({
locateOptions: {maxZoom: 10, enableHighAccuracy: false},
controls.locate = new L.Control.Locate({
locateOptions: {
enableHighAccuracy: false
},
position: 'topleft',
follow: follow,
stopFollowingOnDrag: true,
strings: {
title: window.getI18n("Show me where I am", localLang),
popup: window.getI18n("You are within {distance} {unit} from this point", localLang),
metersUnit: "meters", //TODO: window.getI128n('meters');
feetUnit: "feet", //TODO: window.getI128n('feet');
outsideMapBoundsMsg: window.getI18n("You seem located outside the boundaries of the map", localLang)
},
onLocationError: function(err) {
window.noty({text: err.message, type: 'information', timeout: 1000});
},
onLocationOutsideMapBounds: function(control) {
control.stop();
this.onLocationError( control.options.strings.outsideMapBoundsMsg );
},
});
// Construct home button control
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "ifm-maps",
"version": "2.1.1",
"version": "3.0.0",
"homepage": "https://github.com/FCOO/ifm-maps",
"authors": [
"Jesper Baasch-Larsen jla@fcoo.dk",
......@@ -12,8 +12,8 @@
"url": "git://github.com/FCOO/ifm-maps.git"
},
"dependencies": {
"fcoo-application": "fcoo/fcoo-application#0.0.*",
"fcoo-leaflet": "fcoo/fcoo-leaflet#0.2.*",
"fcoo-application": "fcoo/fcoo-application#^1.2.0",
"fcoo-leaflet": "fcoo/fcoo-leaflet#^1.0.0",
"moment": "^2.11.2",
"jquery-ui": "^1.11.4",
"noty": "^2.3.8",
......@@ -21,7 +21,6 @@
"leaflet-control-legend": "fcoo/leaflet-control-legend",
"leaflet-categorized-layers": "fcoo/leaflet-categorized-layers",
"leaflet-control-osm-geocoder": "https://github.com/k4r573n/leaflet-control-osm-geocoder.git",
"leaflet-plugins": "jblarsen/leaflet-plugins#master",
"leaflet-time-slider": "fcoo/leaflet-time-slider#latest",
"leaflet-control-vertical": "fcoo/leaflet-control-vertical",
"leaflet-control-datetime": "fcoo/leaflet-control-datetime",
......@@ -30,11 +29,9 @@
"leaflet-tilelayer-wms-pydap": "fcoo/leaflet-tilelayer-wms-pydap",
"leaflet-tilelayer-wms-fcoo": "fcoo/leaflet-tilelayer-wms-fcoo",
"leaflet-geojsonlayer-fwarn": "fcoo/leaflet-geojsonlayer-fwarn",
"leaflet.locatecontrol": "jblarsen/leaflet-locatecontrol#^0.44.0",
"leaflet-layer-sealevel-denmark": "fcoo/leaflet-layer-sealevel-denmark",
"leaflet-layer-tides-greenland": "fcoo/leaflet-layer-tides-greenland",
"leaflet-geojsonlayer-msi": "fcoo/leaflet-geojsonlayer-msi",
"raven-js": "~3.2.1"
"leaflet-geojsonlayer-msi": "fcoo/leaflet-geojsonlayer-msi"
},
"overrides": {
"moment": {
......@@ -62,11 +59,6 @@
"main": [
"Control.OSMGeocoder.js"
]
},
"leaflet-plugins": {
"main": [
"control/Permalink.js"
]
}
},
"devDependencies": {
......@@ -86,9 +78,7 @@
"es6"
],
"resolutions": {
"fcoo-application": "0.0.*",
"fcoo-leaflet": "0.2.*",
"jquery": "~1",
"leaflet": "1.0.0-rc.1"
"fcoo-application": "^1.2.0",
"fcoo-leaflet": "^1.0.0"
}
}
\ No newline at end of file
......@@ -18,8 +18,11 @@ module.exports = function(grunt) {
"name" : "", //application name. Default="FCOO.dk"
"color" : "", //background-color of favicons. Default="" => blue color of FCOO's logo. Must have format "#123456"
"faviconColor" : "" //Color of the favicon. Default = "" => automatic set to highest contrast to "color" between 'white' and 'blue color of FCOO's logo'
//..Individual id:value can be added for specific application
"faviconColor" : "", //Color of the favicon. Default = "" => automatic set to highest contrast to "color" between 'white' and 'blue color of FCOO's logo'
"sentryDSN" : "https://e351388bc0af4cf4a0503ff56dfb9d00@app.getsentry.com/78948", //DSN for Sentry
"piwikSiteId" : 1 //Application id for Piwik website analytics
},
"haveJavaScript": true, //true if the application have js-files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment