[Tilecache] Current x value ...... is too far from tile corner .......

Ivan Grcic ivan.grcic at geofoto.hr
Wed Nov 26 08:00:59 EST 2008


Casc,

you define your center in lat,long and your extent in projection
coords. Make sure you end up with same coord. system before you call
map.setCenter (transform lat,long => proj. coords)

regards, Ivan

On Tue, Nov 11, 2008 at 10:44 AM, CaSC <casc84ab at gmail.com> wrote:
>
> Dont worry about my resolutions, I put those due to many attempts, my problem
> is (I think) with
>
> var lon = -122.4625;
> var lat = 40.2532;
> var maxres = 5.6762 / 256;
>
> But I dont know how to configurate this params
>
>
> Alexandre Dube wrote:
>>
>> Hi,
>>
>> I don't really understand the logic of your resolutions. You jump from
>> 2.8 to 0.005 and end with 0.02 ? Anyway, if you use firebug, you could
>> check the actual resolutions of your baseLayer to be sure they are the
>> sames as in your .cfg file.
>>
>> Alexandre
>>
>> CaSC wrote:
>>> Hi Alexandre, i have this configuration:
>>>
>>> Tilecache.cfg:
>>>
>>> [Ortofoto]
>>> type=WMSLayer
>>> url=http://localhost/cgi-bin/mapserv?map=/usr/local/webmapping/sigal/private/data/sigal.map
>>> layers=Ortofoto
>>> bbox=447771.640919811,4530747.8,448508.759080189,4531073.7
>>> resolutions=2.879368,0.005446,0.005314,0.007498,0.007720,0.007556,0.003485,0.005543,0.005859,0.000977,0.001953,0.022173
>>> srs=EPSG:23030
>>> extent_type=loose
>>> size=256,256
>>>
>>> Openlayers (index.html):
>>>
>>> (...)
>>> var lon = -122.4625;
>>>         var lat = 40.2532;
>>>         var zoom = 2;
>>>         var maxres = 5.6762 / 256;
>>>         var map, layer;
>>>      var options = { theme:null,
>>>                      projection:'EPSG:23030',
>>>                      maxExtend: new
>>> OpenLayers.Bounds(447771.640919811,4530747.8,448508.759080189,4531073.7),
>>> resolutions:[2.879368,0.005446,0.005314,0.007498,0.007720,0.007556,0.003485,0.005543,0.005859,0.000977,0.001953,0.022173],
>>>                      };
>>>
>>>        function init(){
>>>             map = new OpenLayers.Map( $('map'), {'maxResolution': maxres,
>>> 'numZoomLevels':10});
>>>
>>>                     layer = new OpenLayers.Layer.WMS("Ortofoto",
>>> "../tilecache/tilecache.cgi?",
>>>                           {layers: 'Ortofoto', format: 'image/png' },
>>>                           {'displayOutsideMaxExtent':false}
>>>                     );
>>>             map.addLayer(layer);
>>>
>>>             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
>>>             map.addControl(new OpenLayers.Control.Permalink());
>>>             map.addControl( new OpenLayers.Control.LayerSwitcher() );
>>>         }
>>>
>>> (...)
>>>
>>>
>>> Alexandre Dube wrote:
>>>
>>>> Firts, I would suggest that you check the resolutions in your
>>>> tilecache.cfg and the ones at your baselayer in OpenLayers. Make sure
>>>> they're the same ( change in your .cfg if that's not the case )
>>>>
>>>> Alexandre
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> Alexandre Dubé
>> Mapgears
>> www.mapgears.com
>>
>> _______________________________________________
>> Tilecache mailing list
>> Tilecache at openlayers.org
>> http://openlayers.org/mailman/listinfo/tilecache
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Current-x-value-......-is-too-far-from-tile-corner-.......-tp20339619p20436277.html
> Sent from the TileCache mailing list archive at Nabble.com.
>
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
>



-- 
Ivan Grcic



More information about the Tilecache mailing list