Skip to content

Commit

Permalink
release-3.3.24
Browse files Browse the repository at this point in the history
  • Loading branch information
elias75015 committed Mar 23, 2023
2 parents 55648f7 + 7c1f96a commit 2e5bdb0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
9 changes: 1 addition & 8 deletions DRAFT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,18 @@
## Summary

Maj des extensions OpenLayers : 3.2.20

## Changelog

* [Added]

- Possibilité de charger un KML, GPX ou GeoJSON directement avec les données sans passer par une URL en utilisant l'option *layerOptions:data*
> Persistance des tracés de calcul (itineraire et iso) entre la 2D / 3D (#100)

* [Changed]

- mise à jour de la version de l'extension geoportail pour openlayers en version 3.2.20 (#100)
- mise à jour ol-ext 3.2.21

* [Removed]

* [Fixed]

- mise à jour de la doc (#102)

* [Deprecated]

* [Security]
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "geoportal-sdk",
"version": "3.3.23",
"date": "22/02/2023",
"SDK2DVersion": "3.3.23",
"SDK3DVersion": "3.3.23",
"version": "3.3.24",
"date": "23/03/2023",
"SDK2DVersion": "3.3.24",
"SDK3DVersion": "3.3.24",
"description": "French Geoportal SDK based on OpenLayers (2D) and iTowns (3D) libraries",
"main": "dist/2d/GpSDK2D-src.js, dist/3d/GpSDK3d-src.js",
"module": "src/SDK2D.js, src/SDK3D.js",
Expand Down Expand Up @@ -73,7 +73,7 @@
"expose-loader": "^0.7.5",
"fs-extra": "^9.0.0",
"geoportal-extensions-itowns": "2.3.10",
"geoportal-extensions-openlayers": "3.2.20",
"geoportal-extensions-openlayers": "3.2.21",
"handlebars": "^4.7.5",
"handlebars-layouts": "^3.1.4",
"html-webpack-plugin": "^4.0.4",
Expand Down
79 changes: 43 additions & 36 deletions src/Itowns/ItMapListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,78 +35,78 @@ ItMap.prototype.listen = function (eventId, action, context) {
var map = this;
var key = null;
switch (eventId) {
case "mapFailure" :
case "mapFailure":
break;
case "mapLoaded" :
case "located" :
case "geolocated" :
case "configured" :
case "mapLoaded":
case "located":
case "geolocated":
case "configured":
// handled in IMap
break;
case "centerChanged" :
case "centerChanged":
var callBackCenterChanged = function (itEvent) {
var centerChangedEvt = {};
if (!itEvent) {
return;
}
if (itEvent.previous) {
centerChangedEvt.oldCenter = {
x : itEvent.previous.x,
y : itEvent.previous.y
x: itEvent.previous.x,
y: itEvent.previous.y
};
}

if (itEvent.new) {
centerChangedEvt.newCenter = {
x : itEvent.new.x,
y : itEvent.new.y
x: itEvent.new.x,
y: itEvent.new.y
};
}
action.call(context, centerChangedEvt);
};
key = map.libMap.listen(itownsExtended.GlobeViewExtended.EVENTS.CENTER_CHANGED, callBackCenterChanged);
break;
case "zoomChanged" :
case "zoomChanged":
var callbackZoomchange = function (itEvent) {
// si le zoom n'a pas changé, on sort
if (itEvent.new === itEvent.previous) {
return;
}
action.call(context, {
oldZoom : itEvent.previous,
newZoom : itEvent.new
oldZoom: itEvent.previous,
newZoom: itEvent.new
});
};
key = map.libMap.listen(itownsExtended.GlobeViewExtended.EVENTS.RANGE_CHANGED, callbackZoomchange);
break;
case "azimuthChanged" :
case "azimuthChanged":
var callbackAzimuthChange = function (itEvent) {
if (itEvent.new.heading === itEvent.previous.heading) {
return;
}
action.call(context, {
oldAzimuth : itEvent.previous.heading,
newAzimuth : itEvent.new.heading
oldAzimuth: itEvent.previous.heading,
newAzimuth: itEvent.new.heading
});
};
key = map.libMap.listen(itownsExtended.GlobeViewExtended.EVENTS.ORIENTATION_CHANGED, callbackAzimuthChange);
break;
case "tiltChanged" :
case "tiltChanged":
var callbackTiltChange = function (itEvent) {
if (itEvent.new.tilt === itEvent.previous.tilt) {
return;
}
action.call(context, {
oldTilt : itEvent.previous.tilt,
newTilt : itEvent.new.tilt
oldTilt: itEvent.previous.tilt,
newTilt: itEvent.new.tilt
});
};
key = map.libMap.listen(itownsExtended.GlobeViewExtended.EVENTS.ORIENTATION_CHANGED, callbackTiltChange);
break;
case "projectionChanged" :
case "projectionChanged":
// TODO : interet ?
break;
case "layerChanged" :
case "layerChanged":
var callbackLayerAdded = function (itevt) {
var ladded = itevt;
var layerIndex;
Expand All @@ -132,8 +132,8 @@ ItMap.prototype.listen = function (eventId, action, context) {

// if itColorLayer is undefined, it is an MNT : the sequence is set to -1
action.call(context, {
layerAdded : layerOpts,
position : layerIndex
layerAdded: layerOpts,
position: layerIndex
});
};
key = map.libMap.listen(itownsExtended.GlobeViewExtended.EVENTS.LAYER_ADDED, callbackLayerAdded);
Expand All @@ -149,7 +149,7 @@ ItMap.prototype.listen = function (eventId, action, context) {
}

action.call(context, {
layerRemoved : layerOpts
layerRemoved: layerOpts
});
// FIXME comment faire le menage des ecouteurs internes ?
setTimeout(function () {
Expand All @@ -175,10 +175,10 @@ ItMap.prototype.listen = function (eventId, action, context) {
var newCommonProp = map._getCommonLayerParams(newItObj);

action.call(context, {
property : ItMap.LAYERPROPERTIES[k],
oldValue : oldCommonProp[ItMap.LAYERPROPERTIES[k]],
newValue : newCommonProp[ItMap.LAYERPROPERTIES[k]],
layerChanged : layerOpts
property: ItMap.LAYERPROPERTIES[k],
oldValue: oldCommonProp[ItMap.LAYERPROPERTIES[k]],
newValue: newCommonProp[ItMap.LAYERPROPERTIES[k]],
layerChanged: layerOpts
});
};

Expand All @@ -192,11 +192,11 @@ ItMap.prototype.listen = function (eventId, action, context) {
};
key = null;
break;
case "controlChanged" :
case "controlChanged":
break;
default :
default:
this.logger.info("unhandled event : " + eventId);
} ;
};
if (key) {
// ajout de l'evenement au tableau des événements
this._registerEvent(key, eventId, action, context);
Expand Down Expand Up @@ -267,8 +267,8 @@ ItMap.prototype._onMapClick = function (evt) {
var content = self._features2html(feats);
// Affichage des features.
var position = {
x : evt.layerX,
y : evt.layerY
x: evt.layerX,
y: evt.layerY
};
self._displayInfo(position, content.innerHTML);
}
Expand Down Expand Up @@ -300,6 +300,7 @@ ItMap.prototype._removeInfoDivs = function () {
ItMap.prototype._features2html = function (features) {
this.logger.trace("[ItMap] : _features2html...");
var content = document.createElement("div");
var content2display = false;
features.forEach(function (f) {
var props = {};
if (f.geometry.properties) {
Expand All @@ -311,25 +312,28 @@ ItMap.prototype._features2html = function (features) {
if (props.hasOwnProperty("name")) {
nameDiv.innerHTML = props.name;
content.appendChild(nameDiv);
content2display = true;
}
if (props.hasOwnProperty("description")) {
var descDiv = document.createElement("div");
descDiv.className = "gp-att-description-div";
descDiv.innerHTML = props["description"];
content.appendChild(descDiv);
content2display = true;
}
var p = null;
var others = false;
var oDiv = null;
var ul = null;
var li = null;
for (p in props) {
if (p === "name" || p === "description" || p === "styleUrl" || p === "styleHash") {
// on ne prend que les propriété affichables (string)
if (typeof props[p] !== "string" || p === "name" || p === "description" || p === "styleUrl" || p === "styleHash") {
continue;
}

// patch en attendant que les proprietes de style et autres attributs indesirables soient dissocies des autres proprietes dans itowns
if (p === "stroke" || p === "stroke-opacity" || p === "stroke-width" || p === "fill" || p === "fill-opacity" || p === "_idx" || p === "_meshIdx" || p === "coordTimes" || p === "style") {
if (p === "icon" || p === "stroke" || p === "stroke-opacity" || p === "stroke-width" || p === "fill" || p === "fill-opacity" || p === "_idx" || p === "_meshIdx" || p === "coordTimes" || p === "style") {
continue;
}

Expand All @@ -338,6 +342,7 @@ ItMap.prototype._features2html = function (features) {
oDiv.className = "gp-att-others-div";
ul = document.createElement("ul");
others = true;
content2display = true;
}
li = document.createElement("li");
var span = document.createElement("span");
Expand All @@ -352,7 +357,9 @@ ItMap.prototype._features2html = function (features) {
content.appendChild(oDiv);
}
}, this);

if (!content2display) {
return;
}
return content;
};

Expand Down

0 comments on commit 2e5bdb0

Please sign in to comment.