-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Geomap: Port of the Geomap plugin to WET v4.0
- Loading branch information
1 parent
e645e39
commit a118c44
Showing
29 changed files
with
9,603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
src/polyfills/slider/slider.js | ||
src/polyfills/events/mobile.js | ||
src/plugins/geomap/data/config-en.js | ||
src/plugins/geomap/data/config-fr.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?eclipse-pydev version="1.0"?> | ||
|
||
<pydev_project> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> | ||
</pydev_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* @title WET-BOEW Geomap debug | ||
* @overview Debug messages for Geomap | ||
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html | ||
* @author @pjackson28 | ||
*/ | ||
(function( $, window, wb ) { | ||
"use strict"; | ||
|
||
var $document = wb.doc, | ||
$wbMainIn, warningStart, errorStart, msgEnd, messages, | ||
debugMessages = { | ||
en: { | ||
debugMode: "WET-Geomap: running in DEBUG mode", | ||
debugMess: "When running in debug mode Geomap will provide inline error and help messages and write useful debugging information into the console. Disable debug mode by removing the <em>debug</em> class.", | ||
overlayLoad: "WET-Geomap: overlays were loaded successfully", | ||
overlayNotLoad: "WET-Geomap: an error occurred while loading overlays", | ||
basemapDefault: "WET-Geomap: using default basemap", | ||
projection: "WET-Geomap: using projection", | ||
error: "WET-Geomap ERROR", | ||
warning: "WET-Geomap WARNING", | ||
warningLegend: "No div element with a class of <em>wet-boew-geomap-legend</em> was found. If you require a legend either add a div with a class of <em>wet-boew-geomap-legend</em>.", | ||
overlayNotSpecify: "WET-Geomap: overlays file not specified", | ||
baseMapMapOptionsLoadError: "WET-Geomap: an error occurred when loading the mapOptions in your basemap configuration. Please ensure that you have the following options set: maxExtent (e.g. '-3000000.0, -800000.0, 4000000.0, 3900000.0'), maxResolution (e.g. 'auto'), projection (e.g. 'EPSG:3978'), restrictedExtent (e.g. '-3000000.0, -800000.0, 4000000.0, 3900000.0'), units (e.g. 'm'), displayProjection: (e.g. 'EPSG:4269'), numZoomLevels: (e.g. 12), aspectRatio: (e.g. 0.8).", | ||
warningTab: "No class <em>tab</em> in wet-boew-geomap but a table has tab attribute set to true.", | ||
layersNotSpecify: "No div with id <em>wet-boew-geomap-layers</em> have been found. You need to add one." | ||
}, | ||
fr: { | ||
debugMode: "BOEW-Géocarte : mode débogage activé", | ||
debugMess: "Lors de l'exécution en mode débogage Geomap donne des messages d'erreur, des messages d'aide et donneras de l'information utile dans la console de débogage. Désactiver le mode débogage en supprimant la classe <em>debug</em>.", | ||
overlayLoad: "BOEW-Géocarte : Les couches de superpositions ont été chargées avec succès", | ||
overlayNotLoad: "BOEW-Géocarte : une erreur est survenue lors du chargement des couches de superpositions", | ||
basemapDefault: "BOEW-Géocarte : la carte de base par défaut est utilisée", | ||
projection: "BOEW-Géocarte : la projection utilisée est", | ||
error: "BOEW-Géocarte ERREUR", | ||
warning: "BOEW-Geomap AVERTISSEMENT", | ||
warningLegend: "Aucun élément div comportant une classe <em>wet-boew-geomap-legend</em> n'a été trouvé. Si vous avez besoin d'une légende, vous pouvez ajouter un élément div avec une classe <em>wet-boew-geomap-legend</em>.", | ||
overlayNotSpecify: "BOEW-Géocarte : fichier des couches de superpositions non spécifié", | ||
baseMapMapOptionsLoadError: "BOEW-Géocarte : une erreur est survenue lors du chargement des options de configuration de votre carte de base. S'il vous plaît, vérifiez que vous avez l'ensemble des options suivantes: maxExtent (ex: '-3000000,0, -800000,0, 4000000,0, 3900000,0'), maxResolution (ex: 'auto'), projection (ex: 'EPSG: 3978'), restrictedExtent (ex: '-3000000,0 , -800000,0, 4000000,0, 3900000,0'), units (ex: 'm'), displayProjection (ex: 'EPSG: 4269'), numZoomLevels (ex: 12), aspectRatio: (ex: 0.8).", | ||
warningTab: "Il n'y a pas de classe <em>tab</em> dans wet-boew-geomap mais une table a l'attribut égal vrai.", | ||
layersNotSpecify: "Il n'y a pas de div avec le id <em>wet-boew-geomap-layers</em>. Vous devez en ajouter un." | ||
} | ||
}, | ||
|
||
init = function() { | ||
messages = debugMessages[ ( document.documentElement.lang === "fr" ? "fr" : "en" ) ]; | ||
|
||
var debugMode = messages.debugMode, | ||
msgStart = "<div style='border: 3px dashed #000; padding: 10px; color: #000; background: #fff;'><h3>", | ||
msgMiddle = "</h3><p>", | ||
|
||
msgEnd = "</p></div>"; | ||
$wbMainIn = $( "#wb-main-in" ); | ||
warningStart = msgStart + messages.warning + msgMiddle; | ||
errorStart = "<div style='border: 3px dashed #000; padding: 10px; color: #C00; font-weight: 700; background: #fff;'><h3>" + messages.error + msgMiddle; | ||
|
||
window.console.log( debugMode ); | ||
$wbMainIn.prepend( msgStart + debugMode + msgMiddle + messages.debugMess + msgEnd ); | ||
}; | ||
|
||
$document.on( "debug.wb-geomap overlayLoad.wb-geomap overlayNotLoad.wb-geomap overlayNotSpecify.wb-geomap warningLegend.wb-geomap warningTab.wb-geomap errorSelect.wb-geomap errorNoSelect.wb-geomap basemapDefault.wb-geomap baseMapMapOptionsLoadError.wb-geomap projection.wb-geomap layersNotSpecify.wb-geomap", function( event, param1 ) { | ||
var type = event.type, | ||
console = window.console; | ||
|
||
switch ( type ) { | ||
case "debug": | ||
init(); | ||
break; | ||
case "overlayLoad": | ||
console.log( messages.overlayLoad ); | ||
break; | ||
case "overlayNotLoad": | ||
console.log( messages.overlayNotLoad ); | ||
break; | ||
case "overlayNotSpecify": | ||
console.log( messages.overlayNotSpecify ); | ||
break; | ||
case "warningLegend": | ||
$wbMainIn.prepend( warningStart + messages.warningLegend + msgEnd ); | ||
break; | ||
case "warningTab": | ||
$wbMainIn.prepend( warningStart + messages.warningTab + msgEnd ); | ||
break; | ||
case "errorSelect": | ||
param1.append( errorStart + messages.errorSelect + msgEnd ); | ||
break; | ||
case "errorNoSelect": | ||
param1.before( errorStart + messages.errorNoSelect + msgEnd ); | ||
break; | ||
case "basemapDefault": | ||
console.log( messages.basemapDefault ); | ||
break; | ||
case "baseMapMapOptionsLoadError": | ||
console.log( messages.baseMapMapOptionsLoadError ); | ||
break; | ||
case "projection": | ||
console.log( messages.projection + " " + param1 ); | ||
break; | ||
case "layersNotSpecify": | ||
$wbMainIn.prepend( warningStart + messages.layersNotSpecify + msgEnd ); | ||
break; | ||
} | ||
}); | ||
|
||
})( jQuery, window, wb ); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
/* | ||
* @title WET-BOEW Geomap English config file | ||
* @overview Example English configuration file for Geomap | ||
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html | ||
* @author @pjackson28 | ||
*/ | ||
|
||
/* | ||
* Global overrides for individual components | ||
* | ||
* Map Overlays (i.e. layers) | ||
* Overlays will be added in the order that they are provided | ||
* (i.e. the first overlay will be added first, then the next | ||
* on top, and so on). | ||
* | ||
* Note that the basemap can be set globally in settings.js. | ||
*/ | ||
/*jshint unused:false*/ | ||
var wet_boew_geomap = { | ||
// OPTIONAL: note that Geomap will provide a default basemap if not specified here. | ||
/* | ||
basemap: { | ||
title: "CBMT", | ||
type: "wms", | ||
url: "http://geogratis.gc.ca/maps/CBMT", | ||
layers: "CBMT", | ||
format: "image/png", | ||
version: "1.1.1", | ||
options: { | ||
singleTile: false, | ||
ratio: 1.0, | ||
projection: "EPSG:3978", | ||
fractionalZoom: true | ||
}, | ||
mapOptions: { | ||
maxExtent: "-3000000.0, -800000.0, 4000000.0, 3900000.0", | ||
maxResolution: "auto", | ||
projection: "EPSG:3978", | ||
restrictedExtent: "-3000000.0, -800000.0, 4000000.0, 3900000.0", | ||
units: "m", | ||
displayProjection: "EPSG:4269", | ||
numZoomLevels: 12 | ||
} | ||
}, | ||
*/ | ||
|
||
/*basemap : { | ||
title: "WMS Demo", | ||
type: "wms", | ||
url: "http://vmap0.tiles.osgeo.org/wms/vmap0", | ||
layers: "basic", | ||
mapOptions: { | ||
maxExtent: "-180, -90, 180, 90", | ||
maxResolution: "auto", | ||
projection: "EPSG:4326", | ||
restrictedExtent: "-180, -90, 180, 90", | ||
units: "m", | ||
displayProjection: "EPSG:4326", | ||
tileManager: null | ||
} | ||
},*/ | ||
overlays: [ | ||
{ | ||
title: "KML Demo EN", | ||
caption: "This is a sample KML file loaded locally by Geomap.", | ||
type: "kml", | ||
url: "demo/sample.kml", | ||
visible: true, | ||
datatable: false, | ||
tab: true, | ||
popups: true, | ||
attributes: { | ||
name: "Product Title", | ||
description: "Description" | ||
} | ||
}, | ||
{ | ||
title: "ATOM Demo EN", | ||
caption: "This is a sample ATOM feed loaded locally by Geomap.", | ||
type: "atom", | ||
url: "demo/sample.atom", | ||
tab: true, | ||
attributes: { | ||
title: "Title", | ||
summary: "About this dataset" | ||
}, | ||
visible: true | ||
}, | ||
{ | ||
title: "GeoRSS Demo EN", | ||
caption: "This is a sample GeoRSS feed loaded locally by Geomap.", | ||
type: "georss", | ||
url: "demo/sample.rss", | ||
attributes: { | ||
title: "Title", | ||
description: "Description", | ||
link: "More Info" | ||
}, | ||
visible: true, | ||
datatable: false, | ||
tab: true | ||
}, | ||
{ | ||
title: "JSON (GeoGratis) EN", | ||
caption: "This is a sample dataset loaded from a remote JSON resource, in this case the GeoGratis API.", | ||
type: "json", | ||
url: "http://geogratis.gc.ca/api/en/nrcan-rncan/ess-sst", | ||
params: { | ||
alt: "json", | ||
q: "alluvial" | ||
}, | ||
visible: true, | ||
root: "products", | ||
popups: true, | ||
tab: true, | ||
attributes: { | ||
title: "Title", | ||
summary: "Abstract", | ||
author: "Author" | ||
} | ||
}, | ||
{ | ||
title: "GeoJSON (CartoDB) EN", | ||
caption: "This is a sample dataset loaded from a remote GeoJSON resource, in this case traffic cameras in the city of Ottawa from the CartoDB API.", | ||
type: "geojson", | ||
url: "http://stephenott.cartodb.com/api/v2/sql", | ||
params: { | ||
format: "GeoJSON", | ||
q: "SELECT * FROM traffic_cameras LIMIT 25" | ||
}, | ||
attributes: { | ||
location_desc: "Location", | ||
longitude: "Latitude", | ||
latitude: "Longitude", | ||
updated_at: "Last updated" | ||
}, | ||
visible: true, | ||
zoom: true, | ||
datatable: true, | ||
tab: true, | ||
|
||
// default style | ||
style: { | ||
type: "symbol", | ||
init: { | ||
graphicWidth: 30, | ||
graphicHeight: 30, | ||
externalGraphic: "demo/trafficcamera.png", | ||
graphicOpacity: 1.0 | ||
}, | ||
select: { | ||
graphicWidth: 20, | ||
graphicHeight: 20, | ||
externalGraphic: "demo/trafficcamera_active.png", | ||
graphicOpacity: 0.5 | ||
} | ||
} | ||
|
||
/* | ||
// unique value style | ||
style: { | ||
type: "unique", | ||
field: "Location", | ||
init: { | ||
"Bayshore & Richmond": { | ||
pointRadius: "25", | ||
strokeWidth: "20", | ||
strokeColor: "#800080" | ||
}, | ||
"Baseline & Greenbank": { | ||
pointRadius: "25", | ||
strokeWidth: "10", | ||
fillColor: "#800080" | ||
} | ||
}, | ||
select: { | ||
pointRadius: 30, | ||
externalGraphic: "demo/icons/OverIcon.png", | ||
label: "${Location}", | ||
fillOpacity: 0.90 | ||
} | ||
} | ||
// rule style | ||
style: { | ||
type: "rule", | ||
rule: [{ | ||
field: "Longitude", | ||
value: [45.36], | ||
filter: "LESS_THAN", | ||
init: { | ||
pointRadius: "15", | ||
strokeColor: "#800000", | ||
fillColor: "#FFFFFF", | ||
fillOpacity: 0.90 | ||
} | ||
}, | ||
{ | ||
field: "Longitude", | ||
value: [45.37, 45.42], | ||
filter: "BETWEEN", | ||
init: { | ||
pointRadius: "25", | ||
strokeColor: "#000000", | ||
fillColor: "#222222", | ||
fillOpacity: 0.90 | ||
} | ||
}, | ||
{ | ||
field: "Longitude", | ||
value: [45.42], | ||
filter: "GREATER_THAN", | ||
init: { | ||
pointRadius: "10", | ||
strokeColor: "#800080", | ||
fillColor: "#800080" | ||
} | ||
}], | ||
select: { | ||
pointRadius: "30", | ||
externalGraphic: "demo/icons/OverIcon.png", | ||
label: "Selected", | ||
fillOpacity: 0.90 | ||
} | ||
} | ||
*/ | ||
} | ||
] | ||
}; |
Oops, something went wrong.