I work with a local italian projection (EPSG:3003 Monte Mario Italy zone 1) and I had loaded this projection in my project for evitate to reproject all of my data.
I had created the tile pyramid with the last version of gdal2tiles (the version shipped with the last version of maptiler open source [see http://trac.osgeo.org/gdal/ticket/2052] to be able to generate jpeg tiles instead of png tiles)
my problem is that I don't be able to assign the correct extent to my page.If I assign to the montemarioProjection the extent for italy, also this extent is applied to my map, but my map contains only the municipality of modena.My extent of tms of modena, calculated by gdal2tiles, seems to be ignored.
when i try to pan to a certain coordinate point in monte mario coordinate system, map goes in a wrong place, because is not positioned well.
some examples
HERE I HAD ASSIGNED TO MONTE MARIO ONLY MODENA EXTENT AS EXTENT, NOT ITALY)
EXAMPLE 1 http://mappe-t.comune.modena.it/ortofoto/2014/ol3_ortofoto.html
(HERE I HAD ASSIGNED TO MONTE MARIO HIS REAL EXTENT AND TRIED TO FORCE MAP ORIGIN,BUT IT WAS IGNORED. I HAVE TO REMOVE extent parameter from ol.layer.tile and ol.view)
EXAMPLE 2 http://mappe-t.comune.modena.it/ortofoto/2014/ol3_ortofoto2.html
see lines 111-115
origin: tileGrid: new ol.tilegrid.TileGrid({ //tileGrid: new ol.tilegrid.XYZ({ origin: tms_origin, resolutions: tms_resolutions }),IF LOOK AT MOUSEPOSITION CONTROL, THE COORDINATES IS WRONG IN EXAMPLE 1 AND 2
HERE IS ALL OF MY CODE FROM EXAMPLE 2 (WITHOUT COMMENTED PARTS)
var tms_extent = [ 1640349.34499999997206, 4935769.97499999962747, 1659997.04499999992549, 4956992.87500000000000 ]; var tms_origin = [1640349.34499999997206, 4935769.97499999962747]; var tms_resolutions = [ 12.79999999999997, 6.39999999999999, 3.19999999999999, 1.60000000000000, 0.80000000000000, 0.40000000000000, 0.20000000000000, 0.10000000000000 ]; var city_center = [ 1652769.73, 4945475.55 ]; var monteMarioSystemCode = 'EPSG:3003'; var projectionMonteMario = ol.proj.get(monteMarioSystemCode); var extent_italia_monte_mario = [1290679.24, 4194066.17, 2226886.34, 5259894.49]; projectionMonteMario.setExtent(extent_italia_monte_mario); var map = new ol.Map({ controls: ol.control.defaults({ attribution: false }).extend( [ new ol.control.ZoomSlider(), new ol.control.ScaleLine(), new ol.control.MousePosition({ coordinateFormat: ol.coordinate.createStringXY(4), projection: monteMarioSystemCode, undefinedHTML: ' ' }) ]), layers : [ new ol.layer.Tile({ source : new ol.source.XYZ({ crossOrigin : null, //experimental parameter projection : monteMarioSystemCode, //experimental parameter (necessary because gdal2tiles generate tiles in TMS mode not in XYZ mode) tileUrlFunction : function(coordinate) { if (coordinate == null) { return ""; } // type of ol.TileCoord is recently changed to an array of three numbers: [z, x, y] var z = coordinate[0]; var x = coordinate[1]; var y = (1
I had created the tile pyramid with the last version of gdal2tiles (the version shipped with the last version of maptiler open source [see http://trac.osgeo.org/gdal/ticket/2052] to be able to generate jpeg tiles instead of png tiles)
my problem is that I don't be able to assign the correct extent to my page.If I assign to the montemarioProjection the extent for italy, also this extent is applied to my map, but my map contains only the municipality of modena.My extent of tms of modena, calculated by gdal2tiles, seems to be ignored.
when i try to pan to a certain coordinate point in monte mario coordinate system, map goes in a wrong place, because is not positioned well.
some examples
EXAMPLE 1 http://mappe-t.comune.modena.it/ortofoto/2014/ol3_ortofoto.html
(HERE I HAD ASSIGNED TO MONTE MARIO HIS REAL EXTENT AND TRIED TO FORCE MAP ORIGIN,BUT IT WAS IGNORED. I HAVE TO REMOVE extent parameter from ol.layer.tile and ol.view)
EXAMPLE 2 http://mappe-t.comune.modena.it/ortofoto/2014/ol3_ortofoto2.html
see lines 111-115
origin: tileGrid: new ol.tilegrid.TileGrid({ //tileGrid: new ol.tilegrid.XYZ({ origin: tms_origin, resolutions: tms_resolutions }),IF LOOK AT MOUSEPOSITION CONTROL, THE COORDINATES IS WRONG IN EXAMPLE 1 AND 2
HERE IS ALL OF MY CODE FROM EXAMPLE 2 (WITHOUT COMMENTED PARTS)
var tms_extent = [ 1640349.34499999997206, 4935769.97499999962747, 1659997.04499999992549, 4956992.87500000000000 ]; var tms_origin = [1640349.34499999997206, 4935769.97499999962747]; var tms_resolutions = [ 12.79999999999997, 6.39999999999999, 3.19999999999999, 1.60000000000000, 0.80000000000000, 0.40000000000000, 0.20000000000000, 0.10000000000000 ]; var city_center = [ 1652769.73, 4945475.55 ]; var monteMarioSystemCode = 'EPSG:3003'; var projectionMonteMario = ol.proj.get(monteMarioSystemCode); var extent_italia_monte_mario = [1290679.24, 4194066.17, 2226886.34, 5259894.49]; projectionMonteMario.setExtent(extent_italia_monte_mario); var map = new ol.Map({ controls: ol.control.defaults({ attribution: false }).extend( [ new ol.control.ZoomSlider(), new ol.control.ScaleLine(), new ol.control.MousePosition({ coordinateFormat: ol.coordinate.createStringXY(4), projection: monteMarioSystemCode, undefinedHTML: ' ' }) ]), layers : [ new ol.layer.Tile({ source : new ol.source.XYZ({ crossOrigin : null, //experimental parameter projection : monteMarioSystemCode, //experimental parameter (necessary because gdal2tiles generate tiles in TMS mode not in XYZ mode) tileUrlFunction : function(coordinate) { if (coordinate == null) { return ""; } // type of ol.TileCoord is recently changed to an array of three numbers: [z, x, y] var z = coordinate[0]; var x = coordinate[1]; var y = (1