Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use projection definition provide by server (including projection extent) #280

Merged
merged 22 commits into from
Feb 7, 2023

Conversation

volterra79
Copy link
Member

@volterra79 volterra79 commented Dec 22, 2022

Related to g3w-suite/g3w-admin#430

Add also a way to get Projection object definition using g3w-admin api /crs/<EPSG_CODE>

Example:

Request:

/crs/3003

Response:

{
    "result": true,
    "data": {
        "epsg": 3003,
        "proj4": "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs",
        "geographic": false,
        "axisinverted": false,
        "extent": [
            1226046.6820902952,
            4047095.260762165,
            1727931.8998958569,
            5214000.012210975
        ]
    }
}

@volterra79 volterra79 added the feature New feature or request label Dec 22, 2022
@volterra79 volterra79 added this to the v3.8 milestone Dec 22, 2022
@volterra79 volterra79 self-assigned this Dec 22, 2022
volterra79 added a commit to g3w-suite/g3w-admin that referenced this pull request Dec 22, 2022
'EPSG:32733': GRID_EXTENT_3857,
'EPSG:25833': [-2465144.8,3638055.41,2885759.28, 9493779.8]
};

const Projection = function(options={}) {
if (!options.crs) return null;
const {epsg, proj4:proj4def, geographic=false, axisinverted=false, extent} = options.crs; // new structure of information crs from server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type of comments (eg. without "external" references) are not very useful, if you really want to communicate something try to be more specific, otherwise it is just additional noise for the reader..

src/app/g3w-ol/projection/projection.js Show resolved Hide resolved
@@ -1672,6 +1667,11 @@ proto._setupViewer = function(width, height) {
this.moveDefaultLayersOnTop(zindex);
});

/**
*
* Register remove addLayer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improve documentation about it (it's quite ambiguous)

# Conflicts:
#	src/app/core/utils/geo.js
#	src/app/g3w-ol/g3w.ol.js
#	src/app/g3w-ol/map/maphelpers.js
#	src/app/g3w-ol/projection/projections.js
#	src/app/gui/map/mapservice.js
#	src/components/MapAddLayer.vue
# Conflicts:
#	src/components/MapAddLayer.vue
volterra79 added a commit to g3w-suite/g3w-admin that referenced this pull request Feb 1, 2023
src/app/g3w-ol/projection/projections.js Outdated Show resolved Hide resolved
src/components/MapAddLayer.vue Outdated Show resolved Hide resolved
src/app/constant.js Show resolved Hide resolved
@volterra79 volterra79 merged commit 69fcc81 into dev Feb 7, 2023
@volterra79 volterra79 deleted the extent_crs branch February 7, 2023 08:28
volterra79 added a commit to g3w-suite/g3w-admin that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants