Custum map from Geoserver

Jela year ago

Hello

Please i am using my map from geoserver calling it with this URL :

http://my.domaine.name:8080/geoserver/gwc/service/tms/1.0.0/urba%3AMaroc/{z}/{x}/{-y}.png

and whene i try to show the map on my app show me that cros origin error

Access to fetch at 'http://XX.XX.XX.XX:8080/geoserver/gwc/service/tms/1.0.0/urba%3AMaroc/1/0/%7B-y%7D.png' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

and whene i go to map layer i find it on red and can't select it

Anton Tananaeva year ago

Looks like your geoserver requires CORS. That's exactly what the error is tell you. You need to disable CORS requirement.

Jela year ago

Hello @Anton Tananaev

Thanks for you answer please where i will disable it i install geoserver in a Ubuntu VM and i make search but didn't find where i will disable it

Anton Tananaeva year ago

I don't know. That's something to ask on the support channels for the geoserver.

Jela year ago

Hello @Anton
Thanks so much for your asnwer i make some search and activate cors & it work fine
But whene i call my URL map the map showed in traccar deformed and can see my device in the correct location

Anton Tananaeva year ago

It probably means that the format is not right.

Jela year ago

i test it in Qgis and it show fine but whene i try to using in traccar not show right

Jela year ago

Please Anton if yoy can check that if it can work for you :

http://54.36.17.188:8080/geoserver/gwc/service/tms/1.0.0/urba%3AMaroc/{z}/{x}/{-y}.png

it work for me on Qgis but in the app she give me e deformed map

Anton Tananaeva year ago

It looks like it's in TMS format, which is not compatible.

Jela year ago

so please wich format i can use ?

Anton Tananaeva year ago

It should be compatible with OSM. Not sure what the format is called.