Re: [mapstore-developers] Map no rendering when for new projection

171 views
Skip to first unread message
Message has been deleted

harry cr7

unread,
Dec 21, 2023, 10:20:59 AM12/21/23
to mapstore-...@googlegroups.com
Dear,
Making sure that you take the correct projection bound on this page  for your working area location" "https://epsg.io/3035"
Making sure that  you take the Proj4 on this page " https://epsg.io/303"
image.png



Localconf.json need to be set up this way 
image.png





Hope it helps




Le jeu. 21 déc. 2023 à 12:54, 'Filipi Santos' via mapstore-developers <mapstore-...@googlegroups.com> a écrit :
Hey guys..I've added a new projection on the Print plugin, by adding it on localConfig.js as:
{
"name": "Print",
"cfg": {
"projectionOptions": {
"projections": [
{
"name": "EPSG:4647",
"value": "EPSG:4647"
},
{
"name": "EPSG:3857",
"value": "EPSG:3857"
},
{
"name": "EPSG:4326",
"value": "EPSG:4326"
}
]
}
}
},

The new one is the 4647, and the other ones are the default from the framework. 

By doing this, i got to see the new projection on the select box, but when selecting it, the map background turns black... and the 4326 as well.. Only the 3857 works.
Screenshot 2023-12-21 at 08.52.45.png


is there anything else i need to do?

ps. i have the projectionDefinition on my localConfig.json as well
"projectionDefs": [
{
"code": "EPSG:4647",
"def": "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=32500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs",
"extent": [
30122005.34,
3638086.74,
35473041.38,
9494203.2
],
"worldExtent": [
-16.1,
32.88,
40.18,
84.73
]
}
]

--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/c49bc349-94c1-4d6f-95b3-9107399555f9n%40googlegroups.com.

harry cr7

unread,
Dec 21, 2023, 10:33:24 AM12/21/23
to mapstore-...@googlegroups.com
sorry i forgot
this part also need to be set up this way in LocalConf.json
image.png

Filipi Santos

unread,
Dec 22, 2023, 4:06:25 AM12/22/23
to mapstore-developers
Hi.... yes... i got my projection from https://epsg.io/4647 and set it up the localConfig.json with both of this information.

First on the "projectionDefs", i added only the new one:

"projectionDefs": [
{
"code": "EPSG:4647",
"def": "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=32500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs",
"extent": [
30122005.34,
3638086.74,
35473041.38,
9494203.2
],
"worldExtent": [
-16.1,
32.88,
40.18,
84.73
]
}
] 

Should I add the default ones as well, or only the new one is fine?

I also added on the "Print" plugin:

{
"name": "Print",
"cfg": {
"projectionOptions": {
"projections": [
{
"name": "EPSG:4647",
"value": "EPSG:4647"
},
{
"name": "EPSG:3857",
"value": "EPSG:3857"
},
{
"name": "EPSG:4326",
"value": "EPSG:4326"
}
]
}
}
},

This i added all 3 projections, the 4647 custom one, and the ones that comes from the base framework (3857 and 4326).

Is that correct?

It is still no showing up the map on the map preview on the print plugin, and it don't render the map on the PDF.

harry cr7

unread,
Dec 22, 2023, 11:41:29 AM12/22/23
to mapstore-...@googlegroups.com
Dear 
making sure that you take the right  proj4 inside the "def"
in your app making sure that you have this:
image

Choose your projection system from the above icon before printing 

Filipi Santos

unread,
Jan 4, 2024, 4:56:58 AM1/4/24
to mapstore-developers
Yeah... i'm doing that...

I think i know where the error is being made. On plugin Print.jsx, there is a method "isAllowed" which checks what layers are allowed to be rendered on a map. I did some changes just to be more visible, but it checks this:

const isProjectionEPSG3857 = projection === 'EPSG:3857';
const isAllowedType = includes(
[
'wms',
'wfs',
'vector',
'graticule',
'empty'
],
layer.type
);
const isWMTSAndAllowedSRS =layer.type === 'wmts' &&
has(layer.allowedSRS, projection);

return (
isProjectionEPSG3857 ||
isAllowedType ||
isWMTSAndAllowedSRS
);

So when i'm out of EPSG:3857, it will check mostly the type, and if layer.allowedSRS has the new projection (for type wmts).

While the only layers that are not being rendered are the background layers, which i have (on my new.json):

{
"type": "osm",
"title": "Open Street Map",
"name": "mapnik",
"source": "osm",
"group": "background",
"visibility": true
},
{
"type": "tileprovider",
"title": "OpenTopoMap",
"provider": "OpenTopoMap",
"name": "OpenTopoMap",
"source": "OpenTopoMap",
"group": "background",
"visibility": false
},
{
"type": "tileprovider",
"title": "Google Maps",
"provider": "GoogleMaps",
"name": "GoogleMaps",
"source": "google",
"group": "background",
"visibility": false
},
{
"type": "tileprovider",
"title": "Google Satellite",
"provider": "GoogleSatellite",
"name": "GoogleSatellite",
"source": "google",
"group": "background",
"visibility": false
},
{
"type": "tileprovider",
"title": "Google Terrain",
"provider": "GoogleTerrain",
"name": "GoogleTerrain",
"source": "google",
"group": "background",
"visibility": false
}

None of them falls under those criterias. What should i do now?

Filipi Santos

unread,
Jan 4, 2024, 4:58:36 AM1/4/24
to mapstore-developers
Btw... i added a "isBackground" so i can always render a background layer... but the backend does not take that in consideration. probably because of the same rules. And i can't customize the backend with this fix.  

harry cr7

unread,
Jan 5, 2024, 2:56:25 PM1/5/24
to mapstore-...@googlegroups.com
Hello
send your localConfig.json file  so that, we can check 

Thanks in advance

Message has been deleted

harry cr7

unread,
Jan 12, 2024, 12:09:22 AM1/12/24
to mapstore-...@googlegroups.com
Hello Dear,
i did not have enough  time to replicate your project. But what i suggested you  to do is:
a-in the config.yaml file, making sure that you configure all the url as below:
image.png

b-change the default background map in newjson and also in localconf.json
c-create a file "setenv.bat" in C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\bin and configure it this way:
image.png

d-making sure that you take the right proj4 for your project in this website "https://epsg.io/27561" and also the correct system of projection. 
e-the printing part need to be set up this way

image.png
if all is set up well. It should work.

i have attached here my own localConf.json and my own  newjson file here

hope it will help you 









Le lun. 8 janv. 2024 à 09:35, 'Filipi Santos' via mapstore-developers <mapstore-...@googlegroups.com> a écrit :
It is attached =)
localConfig.json
new.json
Reply all
Reply to author
Forward
0 new messages