Skip to content

Commit

Permalink
corrections pour la compilation d'itowns
Browse files Browse the repository at this point in the history
  • Loading branch information
pjjmunier committed Apr 17, 2018
1 parent fa5477e commit b964613
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 40 deletions.
51 changes: 39 additions & 12 deletions src/Common/Controls/LayerSwitcherDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var LayerSwitcherDOM = {
draggable : ".draggable-layer",
ghostClass : "GPghostLayer",
animation : 200,
/** Call event function on drag and drop */
// Call event function on drag and drop
onEnd : function (e) {
// FIXME pas terrrible, mais il faut bien passer ce contexte...
context._onDragAndDropLayerClick(e);
Expand Down Expand Up @@ -50,6 +50,8 @@ var LayerSwitcherDOM = {

/**
* Creation du container principal d"affichage des layers (DOM)
*
* @returns {DOMElement} input - element for minimizing/maximizing the layer switcher
*/
_createMainLayersShowElement : function () {
// <!-- Hidden checkbox for minimizing/maximizing -->
Expand All @@ -61,6 +63,8 @@ var LayerSwitcherDOM = {

/**
* Creation du container principal des layers (DOM)
*
* @returns {DOMElement} container - layers list container
*/
_createMainLayersElement : function () {
// ajout de la liste des layers dans le container principal
Expand All @@ -75,6 +79,8 @@ var LayerSwitcherDOM = {

/**
* Creation du container du picto du controle (DOM)
*
* @returns {DOMElement} label
*/
_createMainPictoElement : function () {
var self = this;
Expand Down Expand Up @@ -125,6 +131,8 @@ var LayerSwitcherDOM = {

/**
* Creation du container du panneau d"information (DOM)
*
* @returns {DOMElement} container
*/
_createMainInfoElement : function () {
// gestion du panneau d"information dans le container principal
Expand All @@ -150,6 +158,7 @@ var LayerSwitcherDOM = {
* @param {Boolean} obj.visibility - visibilité de la couche dans la carte (true or false)
* @param {Float} obj.opacity - opacité de la couche
*
* @returns {DOMElement} container
*/
_createContainerLayerElement : function (obj) {
// exemple :
Expand Down Expand Up @@ -199,6 +208,8 @@ var LayerSwitcherDOM = {
* Creation du container des outils basiques du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createBasicToolElement : function (obj) {
// exemple :
Expand All @@ -225,6 +236,8 @@ var LayerSwitcherDOM = {
* Creation du nom du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createBasicToolNameElement : function (obj) {
// exemple :
Expand All @@ -242,6 +255,8 @@ var LayerSwitcherDOM = {
* Creation de l'icone de visibilité du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
* @returns {DOMElement[]} array containing input and label elements
*/
_createBasicToolVisibilityElement : function (obj) {
// exemple :
Expand Down Expand Up @@ -270,15 +285,15 @@ var LayerSwitcherDOM = {
input.addEventListener(
"click",
function (e) {
context._onVisibilityLayerClick.call(context, e);
context._onVisibilityLayerClick(e);
}
);
} else if (input.attachEvent) {
// internet explorer
input.attachEvent(
"onclick",
function (e) {
context._onVisibilityLayerClick.call(context, e);
context._onVisibilityLayerClick(e);
}
);
}
Expand All @@ -293,6 +308,8 @@ var LayerSwitcherDOM = {
* Creation de l'affichage du menu des outils avancés du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement[]} array containing input and label elements
*/
_createAdvancedToolShowElement : function (obj) {
// <input type="checkbox" id="GPshowAdvancedTools_ID_Layer1">
Expand Down Expand Up @@ -320,6 +337,8 @@ var LayerSwitcherDOM = {
* Creation du container des outils avancés du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createAdvancedToolElement : function (obj) {
// exemple :
Expand Down Expand Up @@ -353,6 +372,8 @@ var LayerSwitcherDOM = {
* Creation de l'icone de suppression du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createAdvancedToolDeleteElement : function (obj) {
// exemple :
Expand All @@ -369,15 +390,15 @@ var LayerSwitcherDOM = {
div.addEventListener(
"click",
function (e) {
context._onDropLayerClick.call(context, e);
context._onDropLayerClick(e);
}
);
} else if (div.attachEvent) {
// internet explorer
div.attachEvent(
"onclick",
function (e) {
context._onDropLayerClick.call(context, e);
context._onDropLayerClick(e);
}
);
}
Expand All @@ -389,6 +410,8 @@ var LayerSwitcherDOM = {
* Creation de l'icone d'information du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createAdvancedToolInformationElement : function (obj) {
// exemple :
Expand All @@ -405,15 +428,15 @@ var LayerSwitcherDOM = {
div.addEventListener(
"click",
function (e) {
context._onOpenLayerInfoClick.call(context, e);
context._onOpenLayerInfoClick(e);
}
);
} else if (div.attachEvent) {
// internet explorer
div.attachEvent(
"onclick",
function (e) {
context._onOpenLayerInfoClick.call(context, e);
context._onOpenLayerInfoClick(e);
}
);
}
Expand All @@ -425,6 +448,8 @@ var LayerSwitcherDOM = {
* Creation de l'icone de gestion de l'opacité du layer (DOM)
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement[]} array of two containers
*/
_createAdvancedToolOpacityElement : function (obj) {
// exemple :
Expand Down Expand Up @@ -458,15 +483,15 @@ var LayerSwitcherDOM = {
input.addEventListener(
"change",
function (e) {
context._onChangeLayerOpacity.call(context, e);
context._onChangeLayerOpacity(e);
}
);
} else if (input.attachEvent) {
// internet explorer
input.attachEvent(
"onchange",
function (e) {
context._onChangeLayerOpacity.call(context, e);
context._onChangeLayerOpacity(e);
}
);
}
Expand All @@ -475,15 +500,15 @@ var LayerSwitcherDOM = {
input.addEventListener(
"input",
function (e) {
context._onChangeLayerOpacity.call(context, e);
context._onChangeLayerOpacity(e);
}
);
} else if (input.attachEvent) {
// internet explorer
input.attachEvent(
"oninput",
function (e) {
context._onChangeLayerOpacity.call(context, e);
context._onChangeLayerOpacity(e);
}
);
}
Expand Down Expand Up @@ -518,6 +543,8 @@ var LayerSwitcherDOM = {
* TODO GPlayerInfoLink : mettre en forme les échelles !
*
* @param {Object} obj - options de la couche à ajouter dans le layer switcher
*
* @returns {DOMElement} container
*/
_createContainerLayerInfoElement : function (obj) {
var container = document.createElement("div");
Expand Down Expand Up @@ -619,7 +646,7 @@ var LayerSwitcherDOM = {
if (legends.hasOwnProperty(scale)) {
var urllgd = legends[scale].url;
// on n'affiche pas les légendes pointant vers "nolegend.jpg"
if (typeof urllgd === "string" && urllgd.toLowerCase().indexOf("nolegend.jpg") == -1) {
if (typeof urllgd === "string" && urllgd.toLowerCase().indexOf("nolegend.jpg") === -1) {
// TODO GPlayerInfoPopup
var lgdlink = document.createElement("div");
lgdlink.className = "GPlayerInfoLink";
Expand Down
Loading

0 comments on commit b964613

Please sign in to comment.