Skip to content
Snippets Groups Projects
Commit 6b1692f2 authored by Gaelle.Barris's avatar Gaelle.Barris
Browse files

ajout option checkCoordinatesInMaxExtent (#74)

parent 0b7014ee
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,11 @@ var Class = Utils.Class(Action, { ...@@ -39,6 +39,11 @@ var Class = Utils.Class(Action, {
* {Array} Tableau définissant les projections des coordonnées à saisir. * {Array} Tableau définissant les projections des coordonnées à saisir.
*/ */
displayProjections: [], displayProjections: [],
/**
* Propriété: checkCoordinatesInMAxExtent
* {Boolean} Vérifier si les coordonnées saisies sont dans l'emprise max de la carte.
*/
checkCoordinatesInMaxExtent: true,
/** /**
* Propriété: selectedDisplayProjectionIndex * Propriété: selectedDisplayProjectionIndex
* {Integer} Position de la projection sélectionnée * {Integer} Position de la projection sélectionnée
...@@ -87,7 +92,7 @@ var Class = Utils.Class(Action, { ...@@ -87,7 +92,7 @@ var Class = Utils.Class(Action, {
this.model.displayProjections = this.displayProjections; this.model.displayProjections = this.displayProjections;
this.model.selectedDisplayProjectionIndex = this.selectedDisplayProjectionIndex; this.model.selectedDisplayProjectionIndex = this.selectedDisplayProjectionIndex;
this.model.selectedDisplayProjection = this._selectedDisplayProjection; this.model.selectedDisplayProjection = this._selectedDisplayProjection;
this.model.checkCoordinatesInMaxExtent = this.checkCoordinatesInMaxExtent;
if (_.isNil(this.renderer)) { if (_.isNil(this.renderer)) {
this.renderer = new CoordinatesInputInPlace(div, this.model, options); this.renderer = new CoordinatesInputInPlace(div, this.model, options);
......
...@@ -36,7 +36,7 @@ var Class = Utils.Class(UI, { ...@@ -36,7 +36,7 @@ var Class = Utils.Class(UI, {
if (this.model.proj && this.model.proj !== this.model.mapProjection) { if (this.model.proj && this.model.proj !== this.model.mapProjection) {
maxExtent = ol.proj.transformExtent(maxExtent, this.model.mapProjection, this.model.proj); maxExtent = ol.proj.transformExtent(maxExtent, this.model.mapProjection, this.model.proj);
} }
if (!_.isNil(maxExtent)) { if (this.model.checkCoordinatesInMaxExtent && !_.isNil(maxExtent)) {
if (!ol.extent.containsXY(maxExtent, this.model.x, this.model.y)) { if (!ol.extent.containsXY(maxExtent, this.model.x, this.model.y)) {
var range1 = this.getMessage('RANGE_X_PART_ONE_MESSAGE'); var range1 = this.getMessage('RANGE_X_PART_ONE_MESSAGE');
var range2 = this.getMessage('RANGE_Y_PART_ONE_MESSAGE'); var range2 = this.getMessage('RANGE_Y_PART_ONE_MESSAGE');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment