diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 3271241d2..03ee084ea 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -13,7 +13,7 @@ last * proj4 last -└── proj4@2.5.0 +└── proj4@2.7.0 * proj4leaflet @@ -28,22 +28,22 @@ last * geoportal-access-lib last -└── geoportal-access-lib@2.1.6 +└── geoportal-access-lib@2.1.8 * leaflet -└── leaflet@1.5.1 +└── leaflet@1.7.1 > upgrade to 1.4.0 * leaflet-draw last -└── leaflet-draw@1.0.2 +└── leaflet-draw@1.0.4 * "itowns" -└── "itowns@2.19.0" +└── "itowns@2.33.0" * loglevel diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index 5741449f3..8c1d4d2fb 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -8,6 +8,8 @@ ## Summary +Ajout de la gestion de projections geocentriques + ## Changelog * [Added] @@ -19,6 +21,9 @@ * [Removed] * [Fixed] + + - Gestion des projections geocentriques (ex. EPSG:4978) (#303) + - Correction sur le DOM du profil-alti (#302) * [Security] @@ -26,6 +31,7 @@ + # Extension Geoportail Leaflet, version __VERSION__ **__DATE__** @@ -33,8 +39,6 @@ ## Summary -Reparation du profil altimétrique - ## Changelog * [Added] @@ -47,8 +51,6 @@ Reparation du profil altimétrique * [Fixed] - - Correction et réparation du profil altimétrique de Leaflet (#297) - * [Security] --- diff --git a/build/scripts/release/geoportal-extensions-openlayers-3.0.17.tgz b/build/scripts/release/geoportal-extensions-openlayers-3.0.17.tgz new file mode 100644 index 000000000..758e7ddc7 Binary files /dev/null and b/build/scripts/release/geoportal-extensions-openlayers-3.0.17.tgz differ diff --git a/build/scripts/release/package-openlayers.json b/build/scripts/release/package-openlayers.json index a50ada86c..3eebe086b 100644 --- a/build/scripts/release/package-openlayers.json +++ b/build/scripts/release/package-openlayers.json @@ -1,6 +1,32 @@ { + "keywords" : [ + "geoportail", + "plugin", + "javascript", + "OpenLayers" + ], "module" : "src/OpenLayers/index.js", - "license" : "CECILL-B", + "peerDependencies" : {}, + "version" : "3.0.17", + "bundleDependencies" : [], + "description" : "French Geoportal Extensions for OpenLayers", + "bugs" : {}, + "date" : "16/06/2021", + "devDependencies" : {}, + "homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/extension-openlayers.html", + "author" : "IGNF", + "dependencies" : { + "sortablejs" : "1.8.4", + "node-fetch" : "^2.6.1", + "ol" : "5.3.0", + "@mapbox/mapbox-gl-style-spec" : "13.11.0", + "geoportal-access-lib" : "2.1.8", + "ol-mapbox-style" : "4.2.1", + "eventbusjs" : "0.2.0", + "loglevel" : "1.6.6", + "proj4" : "2.7.0", + "xmldom" : "^0.1.27" + }, "files" : [ "dist/", "src/", @@ -8,39 +34,13 @@ "README.md", "package.json" ], - "bugs" : {}, - "scripts" : {}, - "date" : "11/05/2021", - "bundleDependencies" : [], - "dependencies" : { - "loglevel" : "1.6.6", - "ol-mapbox-style" : "4.2.1", - "@mapbox/mapbox-gl-style-spec" : "13.11.0", - "eventbusjs" : "0.2.0", - "geoportal-access-lib" : "2.1.8", - "node-fetch" : "^2.6.1", - "xmldom" : "^0.1.27", - "proj4" : "2.7.0", - "ol" : "5.3.0", - "sortablejs" : "1.8.4" - }, "name" : "geoportal-extensions-openlayers", - "keywords" : [ - "geoportail", - "plugin", - "javascript", - "OpenLayers" - ], + "scripts" : {}, + "directories" : {}, + "license" : "CECILL-B", + "main" : "dist/GpPluginOpenLayers-src.js", "repository" : { "type" : "git", "url" : "https://github.com/IGNF/geoportal-extensions.git" - }, - "peerDependencies" : {}, - "version" : "3.0.16", - "devDependencies" : {}, - "main" : "dist/GpPluginOpenLayers-src.js", - "homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/extension-openlayers.html", - "directories" : {}, - "description" : "French Geoportal Extensions for OpenLayers", - "author" : "IGNF" + } } diff --git a/doc/CHANGELOG-leaflet.md b/doc/CHANGELOG-leaflet.md index e9eeffb06..60623e97f 100644 --- a/doc/CHANGELOG-leaflet.md +++ b/doc/CHANGELOG-leaflet.md @@ -57,6 +57,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Extension Geoportail Leaflet, version 2.1.9](#extension-geoportail-leaflet-version-219) * [Summary](#summary-15) * [Changelog](#changelog-12) +- [Extension Geoportail Leaflet, version 2.1.10](#extension-geoportail-leaflet-version-2110) + * [Summary](#summary-16) + * [Changelog](#changelog-13) @@ -494,3 +497,29 @@ Nouveau widget de profil altimétrique par défaut, et correctif mineur * [Security] --- +# Extension Geoportail Leaflet, version 2.1.10 + +**16/06/2021** +> Release Extension Geoportail leaflet + +## Summary + +Reparation du profil altimétrique + +## Changelog + +* [Added] + +* [Changed] + +* [Deprecated] + +* [Removed] + +* [Fixed] + + - Correction et réparation du profil altimétrique de Leaflet (#297) + +* [Security] + +--- diff --git a/package.json b/package.json index 09fbb4259..b681d5deb 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "geoportal-extensions", "description": "French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries", - "version": "2.3.6", - "date": "16/06/2021", + "version": "2.3.7", + "date": "22/06/2021", "leafletExtName": "French Geoportal Extension for Leaflet", "leafletExtVersion": "2.1.10", "olExtName": "French Geoportal Extension for OpenLayers", - "olExtVersion": "3.0.17", + "olExtVersion": "3.0.18", "itownsExtName": "French Geoportal Extension for Itowns", "itownsExtVersion": "2.3.3", "main": "dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js", diff --git a/samples-src/pages/openlayers/MousePosition/pages-ol-mouseposition-bundle-projection.html b/samples-src/pages/openlayers/MousePosition/pages-ol-mouseposition-bundle-projection.html index 8279712a8..b53a262e4 100644 --- a/samples-src/pages/openlayers/MousePosition/pages-ol-mouseposition-bundle-projection.html +++ b/samples-src/pages/openlayers/MousePosition/pages-ol-mouseposition-bundle-projection.html @@ -78,7 +78,7 @@

Ajout du Widget d'affichage des coordonnées de la Souris

{ crs : "EPSG:4978", label : "WGS84 (geocent)", - type : "Geographical" + type : "Metric" } ] }); diff --git a/src/Common/CSS/GPelevationPath.css b/src/Common/CSS/GPelevationPath.css index 0c6883e7a..e870562a2 100644 --- a/src/Common/CSS/GPelevationPath.css +++ b/src/Common/CSS/GPelevationPath.css @@ -90,12 +90,12 @@ div[id^=GPelevationPathPanelInfo] { .altiPathValue { font-weight: 700; - color: #5E5E5E; + fill: #5E5E5E; } .altiPathCoords { font-style: italic; - color: #5E5E5E; + fill: #5E5E5E; } .tooltipInit { diff --git a/src/Common/Controls/ProfileElevationPathDOM.js b/src/Common/Controls/ProfileElevationPathDOM.js index ba7fb103c..9c0a2dc94 100644 --- a/src/Common/Controls/ProfileElevationPathDOM.js +++ b/src/Common/Controls/ProfileElevationPathDOM.js @@ -479,12 +479,10 @@ var ProfileElevationPathDOM = { dynamicsG.appendChild(focusLineY); // Tooltip - const tooltipDiv = document.createElement("div"); - const altiSpan = document.createElement("span"); - const br = document.createElement("br"); - const slopeSpan = document.createElement("span"); - const br2 = document.createElement("br"); - const coordsSpan = document.createElement("span"); + const tooltipDiv = document.createElementNS("http://www.w3.org/2000/svg", "text"); + const altiSpan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + const slopeSpan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + const coordsSpan = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); tooltipDiv.setAttribute("style", "text-align:center; max-width:220px; font-size:10px; color:#000000; font-family:Verdana; z-index:50;"); tooltipDiv.style.pointerEvents = "none"; @@ -492,18 +490,25 @@ var ProfileElevationPathDOM = { // tooltipDiv.classList.add("tooltipInit"); // IE... tooltipDiv.setAttribute("class", "tooltipInit"); + tooltipDiv.setAttribute("text-anchor", "middle"); widgetDiv.appendChild(tooltipDiv); altiSpan.setAttribute("class", "altiPathValue"); + altiSpan.setAttribute("x", "0"); + altiSpan.setAttribute("dy", "-.7em"); + slopeSpan.setAttribute("class", "altiPathValue"); + slopeSpan.setAttribute("x", "0"); + slopeSpan.setAttribute("dy", "1em"); + coordsSpan.setAttribute("class", "altiPathCoords"); + coordsSpan.setAttribute("x", "0"); + coordsSpan.setAttribute("dy", "1em"); tooltipDiv.appendChild(altiSpan); - tooltipDiv.appendChild(br); if (_displayProfileOptions.currentSlope) { tooltipDiv.appendChild(slopeSpan); - tooltipDiv.appendChild(br2); } tooltipDiv.appendChild(coordsSpan); @@ -530,6 +535,7 @@ var ProfileElevationPathDOM = { tooltipG.appendChild(tooltipBubbleShadow); tooltipG.appendChild(tooltipBubble); + tooltipG.appendChild(tooltipDiv); // tooltipG.classList.add("tooltipInit"); // IE... deprecated @@ -619,17 +625,14 @@ var ProfileElevationPathDOM = { this._getTextWidth(altiSpanTxt, altiSpan) ); - let tooltipDivLeft = elevationSvg.getBoundingClientRect().left + window.pageXOffset + focusX; - const tooltipDivTop = elevationSvg.getBoundingClientRect().top + window.pageYOffset + focusY - 19; - let toolTipBubbleD; if (d.dist > (dist * factor) / 2) { toolTipBubbleD = `M -0.5 -0.5 l -6 6 l 0 16 l -${tooltipTextWidth + 10} 0 l 0 -44 l ${tooltipTextWidth + 10} 0 l 0 16 l 6 6`; - tooltipDivLeft -= (tooltipTextWidth + 12); + tooltipDiv.setAttribute("transform", `translate(${-(tooltipTextWidth / 2 + 12)},0)`); // IE11 ! } else if (d.dist <= (dist * factor) / 2) { toolTipBubbleD = `M -0.5 -0.5 l 6 6 l 0 16 l ${tooltipTextWidth + 10} 0 l 0 -44 l -${tooltipTextWidth + 10} 0 l 0 16 l -6 6`; // Largeur de la fleche de la bulle du tooltip - tooltipDivLeft += 12; + tooltipDiv.setAttribute("transform", `translate(${(tooltipTextWidth / 2 + 12)},0)`); // IE11 ! } tooltipBubble.setAttribute("d", toolTipBubbleD); @@ -637,9 +640,6 @@ var ProfileElevationPathDOM = { tooltipG.setAttribute("transform", `translate(${focusX},${focusY})`); // IE11 ! tooltipG.style.transform = `translate(${focusX}px,${focusY}px)`; - - tooltipDiv.style.left = `${tooltipDivLeft}px`; - tooltipDiv.style.top = `${tooltipDivTop}px`; }.bind(this)); dynamicsG.appendChild(pathRectangle); diff --git a/src/Common/Utils/Register.js b/src/Common/Utils/Register.js index 4a84ef4d3..1f641ea52 100644 --- a/src/Common/Utils/Register.js +++ b/src/Common/Utils/Register.js @@ -1,10 +1,3 @@ -// FIXME -// - exception lors du register IGNF des projections geocent ? -// Ex. Transforming EPSG:4978 geocent projection fails? -// cf. https://github.com/proj4js/proj4js/issues/195 -// - probleme de performance avec le chargement des projections (env. 4s), -// et ceci bloque le rendu graphique... - /** * Register definition for IGNF, and EPSG CRS. * @example @@ -201,7 +194,7 @@ var Register = { // definitions EPSG : { - // 4978 : "+proj=geocent +datum=WGS84 +units=m +no_defs ", + 4978 : "+proj=geocent +datum=WGS84 +units=m +no_defs ", 3857 : "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", 3785 : "+title=WGS 84 / Pseudo-Mercator (deprecated) +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", 4149 : "+title=CH1903 +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +no_defs ", @@ -485,39 +478,39 @@ var Register = { 84 : "+title=WGS 84 longitude-latitude +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs " }, IGNF : { - // AMST63 : "+title=Amsterdam 1963 +proj=geocent +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // CROZ63 : "+title=Crozet 1963 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // CSG67 : "+title=Guyane CSG67 +proj=geocent +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // ED50 : "+title=ED50 +proj=geocent +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // ETRS89 : "+title=Systeme de reference terrestre Europeen (1989) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // GUAD48 : "+title=Guadeloupe Ste Anne +proj=geocent +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // GUADFM49 : "+title=Guadeloupe Fort Marigot +proj=geocent +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // IGN63 : "+title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=geocent +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // IGN72 : "+title=IGN 1972 Grande-Terre / Ile des Pins +proj=geocent +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // KERG62CAR : "+title=Kerguelen - K0 +proj=geocent +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // MART38 : "+title=Martinique Fort-Desaix +proj=geocent +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // MAYO50 : "+title=Mayotte Combani +proj=geocent +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // MOOREA87 : "+title=Moorea 1987 +proj=geocent +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // NTF : "+title=Nouvelle Triangulation Francaise +proj=geocent +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs", - // NUKU72 : "+title=IGN 1972 Nuku Hiva +proj=geocent +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // REUN47 : "+title=Reunion 1947 +proj=geocent +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // RGF93 : "+title=Reseau geodesique francais 1993 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGFG95 : "+title=Reseau geodesique francais de Guyane 1995 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGM04 : "+title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGNC : "+title=Reseau Geodesique de Nouvelle-Caledonie +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGPF : "+title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGR92 : "+title=Reseau geodesique Reunion 1992 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGSPM06 : "+title=Reseau Geodesique Saint-Pierre-et-Miquelon (2006) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RGTAAF07 : "+title=Reseau Geodesique des TAAF (2007) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // RRAF91 : "+title=RRAF 1991 (Reseau de Reference des Antilles Francaises) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", - // STPL69 : "+title=Saint-Paul 1969 +proj=geocent +towgs84=225.571,-346.608,-46.567,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // STPM50 : "+title=St Pierre et Miquelon 1950 +proj=geocent +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs", - // TAHAA : "+title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=geocent +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // TAHI79 : "+title=IGN79 (Tahiti) Iles de la Societe +proj=geocent +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // TERA50 : "+title=Pointe Geologie - Perroud 1950 +proj=geocent +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // WALL78 : "+title=Wallis-Uvea 1978 (MOP78) +proj=geocent +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", - // WGS72 : "+title=World Geodetic System 1972 +proj=geocent +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs", - // WGS84 : "+title=World Geodetic System 1984 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + AMST63 : "+title=Amsterdam 1963 +proj=geocent +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + CROZ63 : "+title=Crozet 1963 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + CSG67 : "+title=Guyane CSG67 +proj=geocent +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + ED50 : "+title=ED50 +proj=geocent +towgs84=-84.0000,-97.0000,-117.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + ETRS89 : "+title=Systeme de reference terrestre Europeen (1989) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + GUAD48 : "+title=Guadeloupe Ste Anne +proj=geocent +towgs84=-472.2900,-5.6300,-304.1200,0.4362,-0.8374,0.2563,1.898400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + GUADFM49 : "+title=Guadeloupe Fort Marigot +proj=geocent +towgs84=136.5960,248.1480,-429.7890 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + IGN63 : "+title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=geocent +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + IGN72 : "+title=IGN 1972 Grande-Terre / Ile des Pins +proj=geocent +towgs84=-11.6400,-348.6000,291.6800 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + KERG62CAR : "+title=Kerguelen - K0 +proj=geocent +towgs84=144.8990,-186.7700,100.9230 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + MART38 : "+title=Martinique Fort-Desaix +proj=geocent +towgs84=126.9260,547.9390,130.4090,-2.7867,5.1612,-0.8584,13.822650 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + MAYO50 : "+title=Mayotte Combani +proj=geocent +towgs84=-599.9280,-275.5520,-195.6650,-0.0835,-0.4715,0.0602,49.281400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + MOOREA87 : "+title=Moorea 1987 +proj=geocent +towgs84=215.9820,149.5930,176.2290,3.2624,1.6920,1.1571,10.477300 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + NTF : "+title=Nouvelle Triangulation Francaise +proj=geocent +nadgrids=ntf_r93.gsb,null +wktext +towgs84=-168.0000,-60.0000,320.0000 +a=6378249.2000 +rf=293.4660210000000 +units=m +no_defs", + NUKU72 : "+title=IGN 1972 Nuku Hiva +proj=geocent +towgs84=165.7320,216.7200,180.5050,-0.6434,-0.4512,-0.0791,7.420400 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + REUN47 : "+title=Reunion 1947 +proj=geocent +towgs84=789.5240,-626.4860,-89.9040,0.6006,76.7946,-10.5788,-32.324100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + RGF93 : "+title=Reseau geodesique francais 1993 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGFG95 : "+title=Reseau geodesique francais de Guyane 1995 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGM04 : "+title=RGM04 (Reseau Geodesique de Mayotte 2004) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGNC : "+title=Reseau Geodesique de Nouvelle-Caledonie +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGPF : "+title=RGPF (Reseau Geodesique de Polynesie Francaise) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGR92 : "+title=Reseau geodesique Reunion 1992 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGSPM06 : "+title=Reseau Geodesique Saint-Pierre-et-Miquelon (2006) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RGTAAF07 : "+title=Reseau Geodesique des TAAF (2007) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + RRAF91 : "+title=RRAF 1991 (Reseau de Reference des Antilles Francaises) +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", + STPL69 : "+title=Saint-Paul 1969 +proj=geocent +towgs84=225.571,-346.608,-46.567,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + STPM50 : "+title=St Pierre et Miquelon 1950 +proj=geocent +towgs84=-95.5930,573.7630,173.4420,-0.9602,1.2510,-1.3918,42.626500 +a=6378206.4000 +rf=294.9786982000000 +units=m +no_defs", + TAHAA : "+title=Raiatea - Tahaa 51-54 (Tahaa, Base Terme Est) +proj=geocent +towgs84=72.4380,345.9180,79.4860,-1.6045,-0.8823,-0.5565,1.374600 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + TAHI79 : "+title=IGN79 (Tahiti) Iles de la Societe +proj=geocent +towgs84=221.5250,152.9480,176.7680,2.3847,1.3896,0.8770,11.474100 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + TERA50 : "+title=Pointe Geologie - Perroud 1950 +proj=geocent +towgs84=324.9120,153.2820,172.0260 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + WALL78 : "+title=Wallis-Uvea 1978 (MOP78) +proj=geocent +towgs84=253.0000,-133.0000,-127.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", + WGS72 : "+title=World Geodetic System 1972 +proj=geocent +towgs84=0.0000,12.0000,6.0000 +a=6378135.0000 +rf=298.2600000000000 +units=m +no_defs", + WGS84 : "+title=World Geodetic System 1984 +proj=geocent +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs", AMST63GEO : "+title=Amsterdam 1963 +proj=longlat +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", CROZ63GEO : "+title=Crozet 1963 +proj=longlat +nadgrids=null +wktext +towgs84=0.0000,0.0000,0.0000 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", CSG67GEO : "+title=Guyane CSG67 +proj=longlat +towgs84=-193.0660,236.9930,105.4470,0.4814,-0.8074,0.1276,1.564900 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs", diff --git a/src/OpenLayers/CRS/Proj4.js b/src/OpenLayers/CRS/Proj4.js index cdbe2776c..1864e7f6a 100644 --- a/src/OpenLayers/CRS/Proj4.js +++ b/src/OpenLayers/CRS/Proj4.js @@ -1,6 +1,3 @@ -// En attente d'une release sur les projections geocentriques... -// https://github.com/proj4js/proj4js/issues/195 -// https://github.com/proj4js/proj4js/pull/327 import { addCoordinateTransforms, addProjection, @@ -24,10 +21,6 @@ export function register (proj4) { const code = projCodes[i]; if (!get(code)) { const def = proj4.defs(code); - if (def.projName === "geocent") { - logger.trace("proj. geocent :", code); - continue; - } addProjection(new Projection({ code : code, axisOrientation : def.axis, @@ -39,19 +32,11 @@ export function register (proj4) { for (i = 0; i < len; ++i) { const code1 = projCodes[i]; const proj1 = get(code1); - const def1 = proj4.defs(code1); - if (def1.projName === "geocent") { - logger.trace("proj. geocent (source):", code1); - continue; - } + for (j = 0; j < len; ++j) { const code2 = projCodes[j]; const proj2 = get(code2); - const def2 = proj4.defs(code2); - if (def2.projName === "geocent") { - logger.trace("proj. geocent (target):", code2); - continue; - } + if (!getTransform(code1, code2)) { if (proj4.defs[code1] === proj4.defs[code2]) { addEquivalentProjections([proj1, proj2]); diff --git a/test/spec/Common/Utils/test-common-utils-register.js b/test/spec/Common/Utils/test-common-utils-register.js index f0ca1a312..55e22f7d6 100644 --- a/test/spec/Common/Utils/test-common-utils-register.js +++ b/test/spec/Common/Utils/test-common-utils-register.js @@ -50,7 +50,7 @@ describe("-- Test Register --", function () { expect(Register.get("TOTO:1091957")).to.be.undefined; }); - xit("with good param, return an IGNF definition", function () { + it("with good param, return an IGNF definition", function () { expect(Register.get("IGNF:AMST63")).not.to.be.undefined; }); @@ -71,7 +71,7 @@ describe("-- Test Register --", function () { it("CRS:84, return a CRS definition", function () { expect(Register.CRS[84]).not.to.be.undefined; }); - xit("IGNF:AMST63, return a IGNF definition", function () { + it("IGNF:AMST63, return a IGNF definition", function () { expect(Register.IGNF.AMST63).not.to.be.undefined; }); }); @@ -89,7 +89,12 @@ describe("-- Test Register --", function () { expect(status).to.be.false; }); - it("FIXME : add a geocent custom projection defs throw an exception !?", function () { + it("load a geocent custom projection defs", function () { + var status = Register.loadByName(Proj4, "EPSG:4978"); + expect(status).to.be.true; + }); + + it("add a geocent custom projection defs", function () { Register.IGNF = { AMST63 : "+title=Amsterdam 1963 +proj=geocent +towgs84=109.753,-528.133,-362.244,0,0,0,0 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs" }; @@ -97,11 +102,7 @@ describe("-- Test Register --", function () { var status = Register.loadByName(Proj4, "IGNF:AMST63"); expect(status).to.be.true; - try { - Proj4("IGNF:AMST63"); - } catch (e) { - expect(e).to.be.equal("IGNF:AMST63"); - } + expect(Proj4("IGNF:AMST63").oProj.title).to.be.equal("Amsterdam 1963"); }); }); @@ -120,7 +121,7 @@ describe("-- Test Register --", function () { expect(Proj4.defs('EPSG:310642813')).not.to.be.undefined; }); - xit("IGNF:AMST63 is defined", function () { + it("IGNF:AMST63 is defined", function () { expect(Proj4.defs('IGNF:AMST63')).not.to.be.undefined; });