|
From: Roland S. <Rol...@no...> - 2011-03-04 16:10:26
|
Hi,
On 03/04/2011 02:30 AM, Edwin Commandeur wrote:
> Are you using plain GWT or some GUI library?
>
> It is OpenLayers that calculates these offsets for tiled layers.
> Apparently it does this in way that does not play nice with GWT. Have
> you tried untiled (get's the whole map image in one go, versus in
> several tiles)? Or is that no option for you?
I have found that problems like this crop up when the div that contains
the map moves on the page. My solution was to connect a function that
re-centers the map to events that cause the location of the map div to
move on the page. In our case we add and remove some selection elements
above the div pushing it up and down on the page and re-centering the
map each time one of those elements was added/removed fixed the problem.
Roland
public void resizeMap() {
// Do a meaningless little calculation to force the map
to re-calibrate where it is on the page.
int zoom = map.getZoom();
LonLat center = map.getCenter();
map.setCenter(center, zoom);
}
> Greetings,
> Edwin
>
> On 3 March 2011 23:30, Wigger Tims<but...@ho...> wrote:
>> Dear List,
>> In my web application using gwt-openlayers 0.5 and GWT 2.04 I am
>> experiencing a rather annoying problem. When I initially load a WMS, it is
>> visualized without a problem. When I zoom, however, the WMS is shifted, most
>> of the time to the south east. After every pan/ zoom action the offset is
>> difference. When I use firebug in firefox I see can see that the DIV that
>> contains the image has a top and left offset as can be seen below:
>> <div style="overflow: hidden; position: absolute; z-index: 1; left: 218px;
>> top: 96px; width: 1004px; height: 496px;"><img id="OpenLayersDiv499"
>> style="width: 1004px; height: 496px; position: relative;"
>> class="olTileImage"
>> src="xxxxxx/deegree/services?FORMAT=image%2Fpng&TRANSPARENT=TRUE&LAYERS=Lakes%20Rwanda&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&_OLSALT=0.7358005342568256&BBOX=3186029.3265993,-283703.63671876,3493000.4269411,-132052.57519532&WIDTH=1004&HEIGHT=496"></div>
>> The image that is returned by Deegree is fine by the way.
>> Does anyone have an idea what is going wrong and what I can do to solve it?
>> Thanks in advance!
>> Best,
>> Willem
>>
>>
>> ------------------------------------------------------------------------------
>> What You Don't Know About Data Connectivity CAN Hurt You
>> This paper provides an overview of data connectivity, details
>> its effect on application quality, and explores various alternative
>> solutions. http://p.sf.net/sfu/progress-d2d
>> _______________________________________________
>> Gwt-openlayers-users mailing list
>> Gwt...@li...
>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
>>
>>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Gwt-openlayers-users mailing list
> Gwt...@li...
> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
|