[mapguide-users] fusion theme -No access control allow origin error

pierre.cardinal at sympatico.ca pierre.cardinal at sympatico.ca
Tue Jun 6 06:29:42 PDT 2023


Hi Hadis,

 

More exact numbers 

 

If you are designing a map you plan on overlaying over google maps or virtual earth and creating a tiling scheme then i think what you are looking for are the scales for each zoom level, use these:

19 : 1128.497220

18 : 2256.994440

17 : 4513.988880

16 : 9027.977761

15 : 18055.955520

14 : 36111.911040

13 : 72223.822090

12 : 144447.644200

11 : 288895.288400

10 : 577790.576700

9 : 1155581.153000

8  : 2311162.307000

7  : 4622324.614000

6  : 9244649.227000

5  : 18489298.450000

4  : 36978596.910000

3  : 73957193.820000

2  : 147914387.600000

1  : 295828775.300000

0  : 591657550.500000

 

 <https://gis.stackexchange.com/questions/7430/what-ratio-scales-do-google-maps-zoom-levels-correspond-to> https://gis.stackexchange.com/questions/7430/what-ratio-scales-do-google-maps-zoom-levels-correspond-to

 

Regards,

 

Pierre

 

De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de pierre.cardinal at sympatico.ca
Envoyé : 6 juin 2023 09:21
À : 'MapGuide Users Mail List' <mapguide-users at lists.osgeo.org>
Objet : Re: [mapguide-users] fusion theme -No access control allow origin error

 

Hi Hadis,

 

Google satellite data are available for zooms between 0 and 7 (xmax and ymax are 127). To avoid the pink tiles, you should limit the maximum scale factor (or Min Scale for layer config)  to display your layer. 

 


Level

# Tiles

Tile width
(° of longitudes)

m / pixel
(on Equator)

~ Scale
(on screen)

Examples of
areas to represent


0

1

360

156 543

1:500 million

whole world


1

4

180

78 272

1:250 million

	

2

16

90

39 136

1:150 million

subcontinental area


3

64

45

19 568

1:70 million

largest country


4

256

22.5

9 784

1:35 million

	

5

1 024

11.25

4 892

1:15 million

large African country


6

4 096

5.625

2 446

1:10 million

large European country


7

16 384

2.813

1 223

1:4 million

small country, US state

 <https://wiki.openstreetmap.org/wiki/Zoom_levels> https://wiki.openstreetmap.org/wiki/Zoom_levels

 

 



 

 

 

Regards,

 

Pierre

 

 

 

 

 

 

 

 

 

 

De : mapguide-users <mapguide-users-bounces at lists.osgeo.org <mailto:mapguide-users-bounces at lists.osgeo.org> > De la part de Hadis Alinia
Envoyé : 5 juin 2023 23:22
À : MapGuide Users Mail List <mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org> >
Objet : Re: [mapguide-users] fusion theme -No access control allow origin error

 

Pierre

Thank you for your response. By replacing that with  <https://mt0.google.com/vt/lyrs=m&hl=en&x=$%7bx%7d&y=$%7by%7d&z=$%7bz%7d> https://mt0.google.com/vt/lyrs=m&hl=en&x=${x}&y=${y}&z=${z} still I get the error and I see the pink background with no map. However, by using the example tile and specifying  <https://mt0.google.com/vt/lyrs=s&x=1&y=1&z=2> x=1&y=1&z=2 I see the tiles (multiple similar tiles in the fusion) showing somewhere in the world. And when I use the Theme widget it classifies the layer and the tiles are still there. It looks like I am getting close to the right answers and have the background map with the themed layer. 

 

My question is how to get the right tile location and scale that is matched my layer's bounding box.

 

Thank you

Hadis

 

 

 

On Mon, Jun 5, 2023 at 7:11 PM Pierre Cardinal < <mailto:pierre.cardinal at sympatico.ca> pierre.cardinal at sympatico.ca> wrote:

Hi, 

 

The tile  <https://mt1.google.com/vt/lyrs=s&x=262143&y=262143&z=19> https://mt1.google.com/vt/lyrs=s&x=262143&y=262143&z=19 does not exist. Example of a valid one  <https://mt0.google.com/vt/lyrs=s&x=1&y=1&z=2> https://mt0.google.com/vt/lyrs=s&x=1&y=1&z=2

 

Regards,

 

Pierre

 

  _____  

De : mapguide-users <mapguide-users-bounces at lists.osgeo.org <mailto:mapguide-users-bounces at lists.osgeo.org> > de la part de Hadis Alinia <hadissaalinia at gmail.com <mailto:hadissaalinia at gmail.com> >
Envoyé : lundi, juin 5, 2023 2:38:40 p.m.
À : MapGuide Users Mail List <mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org> >
Objet : [mapguide-users] fusion theme -No access control allow origin error

 

Hi, 

I am using MG version 3.1.2 on IIS. On the fusion, when I use the Theme widget I get the themed layers and it's added to the legend but the base map of Openstreet doesn't load and the cursor spins forever. By Looking at the errors in the console I see the 100 errors of "access to the image at  <https://c.tile.openstreetmap.org/5.379310131539869/13/13.png> https://c.tile.openstreetmap.org/5.379310131539869/13/13.png from the origin my website address has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource" and the same error for  <https://b.tile> https://b.tile and a.tile. 

 

Just letting you know I tried adding and removing basemaps even Generic XYZs still get the same results and error. 

 

Removing the openstreet map and with Generic XYZ for google street I get the error as follows:

 

             

        GET  <https://mt1.google.com/vt/lyrs=s&x=262143&y=262143&z=19> https://mt1.google.com/vt/lyrs=s&x=262143&y=262143&z=19 404


Image (async)

		
	
setImgSrc

@

fusionSF.js:72880

	
initImage

@

fusionSF.js:72856

	
renderTile

@

fusionSF.js:72725

	
draw

@

fusionSF.js:72698

	
initGriddedTiles

@

fusionSF.js:81293

	
moveTo

@

fusionSF.js:80764

	
redraw

@

fusionSF.js:56355

	
redraw

@

fusionSF.js:80161

	
setVisibility

@

fusionSF.js:56531

	
setBaseLayer

@

fusionSF.js:54205

	
removeLayer

@

fusionSF.js:54084

	
layerLoaded

@

fusionSF.js:111583

	
(anonymous)

@

fusionSF.js:46681

	
triggerEvent

@

fusionSF.js:108396

	
onRuntimeMapCreated

@

fusionSF.js:131138

	
(anonymous)

@

fusionSF.js:46681

	
respondToReadyState

@

fusionSF.js:97102

	
onStateChange

@

fusionSF.js:97005

	
(anonymous)

@

fusionSF.js:46681

	
XMLHttpRequest.send (async)

		
	
request

@

fusionSF.js:96987

	
initialize

@

fusionSF.js:96931

	
dispatchRequest

@

fusionSF.js:109871

	
loadMap

@

fusionSF.js:130574

	
mapSessionCreated

@

fusionSF.js:130510

	
initialize

@

fusionSF.js:130409

	
loadMapGroup

@

fusionSF.js:111501

	
initialize

@

fusionSF.js:111397

	
create

@

fusionSF.js:109118

	
create

@

fusionSF.js:108672

	
setLoadState

@

fusionSF.js:521

	
scriptLoaded

@

fusionSF.js:639

	
(anonymous)

@

fusionSF.js:46681

	
load (async)

		
	
queueScript

@

fusionSF.js:594

	
require

@

fusionSF.js:1156

	
(anonymous)

@

fusionSF.js:119177

 

I would appreciate it if please assist me to solve this issue.

Thanks

Hadis

 

_______________________________________________
mapguide-users mailing list
 <mailto:mapguide-users at lists.osgeo.org> mapguide-users at lists.osgeo.org
 <https://lists.osgeo.org/mailman/listinfo/mapguide-users> https://lists.osgeo.org/mailman/listinfo/mapguide-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20230606/b991eeb5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 13469 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20230606/b991eeb5/attachment.png>


More information about the mapguide-users mailing list