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
Opening MapStore with parameters #476
Comments
I'm going to summarize below what is already available and what need to be done:
Partially available, we can review existing action capabilities or add one more option to the above:
Available:
TODO. The background layer be injected in the same way of other layers in overlay (point above)
TODO. The style name of the layer should be specified in the request |
fwiw i wouldnt say it's available "like in sviewer", as @jusabatier commented in geosolutions-it/MapStore2#8006 (comment) (but the issue has since then been closed without further discussion) right now it's not straightforward for a user to just 'add a layer from the address bar' as on needs the full
which is a bit cumbersome and error-prone to type, compared to just to reduce friction, maybe we could:
that would result in |
I just tested opening a context by using a POST request with 'map' parameter, but it doesn't work. Isn't POST parameters handles available ? |
Hi @jusabatier it should be. Let us to double check, please. |
Hi @jusabatier, Could you provide us with some information to investigate this? I tested it on our dev instance using sample html file from documentation and it works fine with the following data:
All other parameters are empty. |
As I already said in previous issues, this form is too complex to fill for end users. So I try to implement a simple connector that redirect to mapstore and generate a POST request from simpler parameters. I tried to POST the request directly to a context (
I also tried to add a page attribute to the request and POST it to
But it doesn't work anymore. |
Ok for information to other users, I managed to have it functional. The good endpoint to POST it is : I still have one question concerning this localStorage approach : what happen if we load multiple iFrames in the same page ? This localStorage workaround is not working... Why not simply handle a POST request directly to a context URL (ie. /mapstore/#/context/Iframe) ? |
Hi @jusabatier thank you so much for your feedback.
Yes, good as per documentation here indeed. Thank you so much for clarifying this.
Correct if I'm wrong @alexander-fedorenko, but I think if the origin is the same the sessionStorage is shared. That specific use case probably is not supported but it wasn't an implementation requirement either.
I leave @alexander-fedorenko to answer to this from the tech point of view. |
To quote your first message in this issue :
The sviewer allow to open multiple iframe frome a same page.
As sviewer allow it and considering the context that was explained (communication purposes), it was an implementation requirement... |
Correct if I'm wrong @jusabatier, sviewer supports only GET, right? |
To be able to replace sViewer, the main criteria is the use simplicity. Your implementation in mapstore is not simple to use as it need to know how to configure mapstore's map that provide a huge amount of attributes. Just at this point, it's not able to replace the sviewer, rigth ? We already mention it in another issue with @landryb, prevent that this implementation will overflow URL size limit
So the POST support result from a workaround because your implementation doesn't meet the requirements. In order to move forward, I developed a connector that do the job : https://gitlab.agglo-lepuyenvelay.fr/jusabatier/msiframe But it's just a connector that hide to the end user the cumbersome operation behind. At this point, your localStorage implementation doesn't handle multiple frame in same page. I try to find simple solutions to make your implementation meets the requirement, but at this point you'll have to help me... The simplest way IMO is to handle the POST at the context level (ie. /mapstore/#/context/TheContext). In both case we need to have GET params as simple as sviewer and the ability to include multiple iframes in same page. |
Yes I agree with @jusabatier , this functionnality must be easy to use for a data adminstrator and a simple user too. The aim was to replace sviewer as it was specified. |
Do you have any news about this ? |
Hi @jusabatier, not yet at the moment. As I wrote to @catmorales we will do what possible to meet your request to support multiple iframes but now we need to prioritize issues for group 4. I will provide more feedback as soon as possible. |
Using the map info action (via GET or POST): eg. using the SEARCH:SEARCH_WITH_FILTER action as described in documentation I use this way, but it doesn't work on layers loaded via the map parameter : {
"map":{
"version":2,
"map":{
"layers":[
{
"id":"OSM_DEFAULT_WMTS_GWC",
"format":"image/jpeg",
"thumbURL":"https://geoportail.lepuyenvelay.fr/wp-content/uploads/2021/04/OSM_Classique.jpg",
"group":"background",
"name":"osm:map",
"description":"OpenStreetMap diffusé par GeoBretagne - Style par defaut",
"style":"",
"title":"OpenStreetMap - GeoBretagne",
"type":"wmts",
"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"bbox":{
"crs":"EPSG:4326",
"bounds":{
"minx":"-180.0",
"miny":"-90.0",
"maxx":"180.0",
"maxy":"90.0"
}
},
"visibility":false,
"singleTile":false,
"allowedSRS":{
"EPSG:3857":true
},
"matrixIds":[
"EPSG:3857"
],
"tileMatrixSet":true,
"requestEncoding":"KVP",
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"queryable":true,
"capabilitiesURL":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"useForElevation":false,
"hidden":false,
"params":{
}
},
{
"id":"OSM_GOOGLE_WMTS_GWC",
"format":"image/jpeg",
"thumbURL":"https://geoportail.lepuyenvelay.fr/wp-content/uploads/2021/04/OSM_Google.jpg",
"group":"background",
"name":"osm:google",
"description":"OpenStreetMap diffusé par GeoBretagne - Style 'google'",
"style":"",
"title":"OpenStreetMap / Google - GeoBretagne",
"type":"wmts",
"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"bbox":{
"crs":"EPSG:4326",
"bounds":{
"minx":"-180.0",
"miny":"-90.0",
"maxx":"180.0",
"maxy":"90.0"
}
},
"visibility":false,
"singleTile":false,
"allowedSRS":{
"EPSG:3857":true
},
"matrixIds":[
"EPSG:3857"
],
"tileMatrixSet":true,
"requestEncoding":"KVP",
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"queryable":true,
"capabilitiesURL":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"useForElevation":false,
"hidden":false,
"params":{
}
},
{
"id":"RTGE_WMTS_GWC",
"format":"image/jpeg",
"thumbURL":"https://geoportail.lepuyenvelay.fr/wp-content/uploads/2021/04/RTGE.jpg",
"group":"background",
"name":"rasters:rtge",
"description":"Prise de vue aérienne - Référentiel Très Grande Echelle",
"style":"",
"title":"Prise de vue aérienne - RTGE",
"type":"wmts",
"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"bbox":{
"crs":"EPSG:4326",
"bounds":{
"minx":"-180.0",
"miny":"-90.0",
"maxx":"180.0",
"maxy":"90.0"
}
},
"visibility":false,
"singleTile":false,
"allowedSRS":{
"EPSG:3857":true
},
"matrixIds":[
"EPSG:3857"
],
"tileMatrixSet":true,
"requestEncoding":"KVP",
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"queryable":true,
"capabilitiesURL":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"useForElevation":false,
"hidden":false,
"params":{
}
},
{
"id":"IGN_ORTHO_HR",
"format":"image/png",
"thumbURL":"https://geoportail.lepuyenvelay.fr/wp-content/uploads/2021/04/RTGE.jpg",
"group":"background",
"name":"ign:orthohr",
"description":"IGN - BD ORTHO HR",
"title":"BD ORTHO Haute Résolution diffusée par l'IGN",
"type":"wmts",
"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"bbox":{
"crs":"EPSG:4326",
"bounds":{
"minx":"2.2656832311486865",
"miny":"44.73041941408128",
"maxx":"4.809301780135803",
"maxy":"46.80610148918325"
}
},
"visibility":true,
"singleTile":false,
"allowedSRS":{
"EPSG:3857":true
},
"matrixIds":[
"EPSG:3857"
],
"tileMatrixSet":true,
"requestEncoding":"KVP",
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"queryable":true,
"capabilitiesURL":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"useForElevation":false,
"hidden":false,
"params":{
}
},
{
"id":"PLAN_IGN_WMTS_GWC",
"format":"image/png",
"thumbURL":"https://geoportail.lepuyenvelay.fr/wp-content/uploads/2021/04/Plan_IGN.jpg",
"group":"background",
"name":"ign:plan",
"description":"Représentation graphique des bases de données IGN. Source : IGN",
"style":"",
"title":"Plan IGN",
"type":"wmts",
"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"bbox":{
"crs":"EPSG:4326",
"bounds":{
"minx":"-180.0",
"miny":"-90.0",
"maxx":"180.0",
"maxy":"90.0"
}
},
"visibility":false,
"singleTile":false,
"allowedSRS":{
"EPSG:3857":true
},
"matrixIds":[
"EPSG:3857"
],
"tileMatrixSet":true,
"requestEncoding":"KVP",
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"queryable":true,
"capabilitiesURL":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts",
"useForElevation":false,
"hidden":false,
"params":{
}
},
{
"id":"undefined__5",
"group":"background",
"source":"ol",
"title":"Empty Background",
"type":"empty",
"visibility":false,
"singleTile":false,
"dimensions":[
],
"hideLoading":false,
"handleClickOnLayer":false,
"useForElevation":false,
"hidden":false
},
{
"title":"website:points_de_vente_libelle",
"name":"website:points_de_vente_libelle",
"type":"wms",
"url":"https://geoportail.lepuyenvelay.fr/geoserver/ows",
"visibility":true
}
],
"center":{
"x":432356.5,
"y":5628270.98,
"crs":"EPSG:3857"
},
"zoom":11
}
},
"page":"../../#/context/Iframe",
"actions":[
{
"type":"SEARCH:SEARCH_WITH_FILTER",
"layer":"website:points_de_vente_libelle",
"cql_filter":"id=15"
}
]
} Is it a bug ? Is it possible to correct it to have it work with layers loaded via map parameter ? |
Hi @jusabatier I'm sorry for the late reply.
It is how it works know, SEARCH:SEARCH_WITH_FILTER actions can work with layers added through action CATALOG:ADD_LAYERS_FROM_CATALOGS
I think yes, but I have to ask developers to have a confirmation. Some development is needed anyway to allow this. |
I'm sorry @jusabatier I think I got confused. I did a quick check to be sure and it should work. Look at my sample. The problem is related to WMTS layers. They are preventing the map to be loaded correctly because at the moment the tileMatrixSet should be in configuration for the given source (see my sample configuration). |
Well, I investigated a bit more and it appear that I had to send 'action' as a String to setParameters, not as an object. But I found another bug : if I configure my 'Identifier' plugin with Can you fix this ? |
New development for requested changes tracked with geosolutions-it/MapStore2#8597 according to the agreed proposal. |
Access mapstore directly with one or more layers loaded, set in a request (Get or POST).
This means generating a mapstore map on the fly from all the parameters of the URL to meet
the following needs.
Acceptance Criteria
Allow the visualisation of layers from the metadata catalogue (GeoNetwork)
From the catalog here clicking on the "visualisaton button", will open mapfishapp with the layer loaded.
In Geonetwork:
In Mapfishapp:
Be able to replace the sviewer
Sviewer is a very light geOrchestra viewer that we use so that municipalities can simply integrate maps into their html site. These maps are created on the fly through parameters provided in the GET request. But this viewer is not supported yet.
Here is an example of a map created with the sviewer:
https://app.sig.rennesmetropole.fr/sviewer/?x=-191043&y=6132971&z=16&lb=0&title=Ma%20carte&layers=app%3Asv_sitorg_sport%2Capp%3Asv_metier_v_star_arret_physique
Here is the code: https://github.com/georchestra/sviewer
The goal is to replace sviewer by mapstore.
To create maps on fly, at Rennes Metropole we develop a sviewer generator to create parametrized URLs: https://app.sig.rennesmetropole.fr/sviewer_generator/
Other useful informations
Here the idea is to have the ability to configure the map template via the URL (GET) or by POST request :
-> possible to perform identify (getFeatureInfo) on center at startup (optional)
-> define used style (optional)
-> define CQL filter (optional)
Those functions are very useful for communication purposes, it allow us and our partners to :
Relative issue in MapStore geosolutions-it/MapStore2#8006
The text was updated successfully, but these errors were encountered: