I dropped my plans of extending ImageLayer...the getUrlAsync approach leads to the same problem than with GridLayer (multiple image requests during zoom/pan animation).<br><br>However I have a new idea: what if I manage the layer through a control? It could perform the map request, parse out the map image bounds and url and then add an ImageLayer with the requested image to the map.<br>
<br>If the image layer gets moved, it would trigger a map request through the control. When the map response arrives, the control removes the current layer and adds a new layer to the map.<br><br>Any thoughts on that?<br>
<br>Franz<br>
<br><div class="gmail_quote">2010/8/3 Franz Buchinger <span dir="ltr"><<a href="mailto:fbuchinger@gmail.com" target="_blank">fbuchinger@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In my case, creating the single-tiled map is rather expensive - because the map image is generated "on-the-fly".<br><br>Therefore, I want my layer to "anticipate" the map action (zoom, pan), just like the ImageLayer does.<br>
I actually had a well working implementation of my map viewer based on ImageLayers, but all the logic (requesting new map etc) happened outside the layer and caused side-effects with other layers.<br><br>I'm wondering if it would be better to derive my ProprietaryMapLayer from ImageLayer. <br>
<br>I could extend it with a getUrlAsync method that fetches the map image url based on the new extent after a map action was performed.<br><br>Would that work?<br><br>Franz<br><br><div class="gmail_quote">2010/8/3 <span dir="ltr"><<a href="mailto:christopher.schmidt@nokia.com" target="_blank">christopher.schmidt@nokia.com</a>></span><div>
<div></div><div><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><br>
On Aug 3, 2010, at 9:42 AM, ext Franz Buchinger wrote:<br>
<br>
> Hi Bart,<br>
><br>
> yes, I've set these options. I noticed that these multiple requests only happen when I set transitionEffect: 'resize'.<br>
<br>
</div>This is basically expected. The transition effect creates multiple tiles, and since<br>
creating images is generally considered to be 'cheap' in OpenLayers -- since<br>
images should be served from cache -- we just create more tiles, rather than<br>
copying existing ones in any way.<br>
<br>
So this is by design; if you don't like the design, you'll need to do some<br>
more coding to fix it :)<br>
<br>
-- Chris<br>
<div><div></div><div><br>
> I'm using OpenLayers 2.9.1.<br>
><br>
> Franz<br>
><br>
><br>
><br>
> 2010/8/3 Bart van den Eijnden (OSGIS) <<a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a>><br>
> Hi Franz,<br>
><br>
> and have you verified you only have a single tile?<br>
><br>
> Do you have singleTile: true, ratio: 1 and buffer: 0 in your layer options?<br>
><br>
> Best regards,<br>
> Bart<br>
><br>
> > Hi Bart,<br>
> ><br>
> > I'm almost done with my layer implementation. The only problem: my<br>
> > getURLasync() Method gets triggered far too often (about 3x per pan/zoom<br>
> > action).<br>
> ><br>
> > How can I make sure that getURLasync is only triggered once per map<br>
> > action?<br>
> ><br>
> > Franz<br>
> ><br>
> > 2010/8/3 Bart van den Eijnden (OSGIS) <<a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a>><br>
> ><br>
> >> Hi Franz,<br>
> >><br>
> >> check out OpenLayers.Tile.Image.<br>
> >><br>
> >> Best regards,<br>
> >> Bart<br>
> >><br>
> >> > Hi Bart,<br>
> >> ><br>
> >> > thanks for the fast and helpful response!<br>
> >> ><br>
> >> > One question though: which class actually invokes the methods<br>
> >> > OpenLayers.Layer.ArcIMS.getUrl and OpenLayers.Layer.getUrlAsync?<br>
> >> ><br>
> >> > They seem to be overriden methods, but i couldn't find them in<br>
> >> > OpenLayers.Layer.Grid or OpenLayers.Layer.HTTPRequest.<br>
> >> ><br>
> >> > kind regards,<br>
> >> ><br>
> >> > Franz<br>
> >> ><br>
> >> > 2010/8/3 Bart van den Eijnden (OSGIS) <<a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a>><br>
> >> ><br>
> >> >> Hi,<br>
> >> >><br>
> >> >> I would advise you to look at OpenLayers.Layer.ArcIMS which uses a<br>
> >> >> similar<br>
> >> >> approach.<br>
> >> >><br>
> >> >> Best regards,<br>
> >> >> Bart<br>
> >> >><br>
> >> >> > Hi,<br>
> >> >> ><br>
> >> >> > I'm a frontend developer and was programming a web viewer for a<br>
> >> >> > proprietary,<br>
> >> >> > WMS-like map service.<br>
> >> >> > I discovered Openlayers one month ago and I'm really fascinated by<br>
> >> its<br>
> >> >> > awesome capabilities, so I decided to integrate our map service in<br>
> >> >> > OpenLayers.<br>
> >> >> ><br>
> >> >> > Here is a short description how the map service works:<br>
> >> >> ><br>
> >> >> > The client sends an AJAX request containing the current map bounds,<br>
> >> >> the<br>
> >> >> > map<br>
> >> >> > id and the pixel size of the map.<br>
> >> >> ><br>
> >> >><br>
> >> map=22&px=1720&py=833&left=2504400&right=2544000&top=5699500&bottom=5669500&type=0<br>
> >> >> ><br>
> >> >> > The server responds with the generated map image (url) and the<br>
> >> >> corrected<br>
> >> >> > bounds:<br>
> >> >> > <MapProperties><br>
> >> >> > <mapLeft>2493227.6110444176</mapLeft><br>
> >> >> > <mapTop>5699500</mapTop><br>
> >> >> > <mapRight>2555172.3889555824</mapRight><br>
> >> >> > <mapBottom>5669500</mapBottom><br>
> >> >> > <mapType>0</mapType><br>
> >> >> > <overviewMap>22</overviewMap><br>
> >> >> > <url><br>
> >> >> <a href="http://localhost/cgmCache/41600065-c3d2-4934-9feb-78a32f6668c8.png" target="_blank">http://localhost/cgmCache/41600065-c3d2-4934-9feb-78a32f6668c8.png</a><br>
> >> >> > </url><br>
> >> >> > </MapProperties><br>
> >> >> ><br>
> >> >> > The maps are always single-tiled.<br>
> >> >> ><br>
> >> >> > My first approach was to write a ProprietaryMapLayer, that executes<br>
> >> >> the<br>
> >> >> > map<br>
> >> >> > request and creates an ImageLayer with the result url and its<br>
> >> bounds.<br>
> >> >> > When the ImageLayer is moved, a new request is performed, the<br>
> >> current<br>
> >> >> > ImageLayer is destroyed and a new one generated. The disadvantage:<br>
> >> >> there<br>
> >> >> > are<br>
> >> >> > now 2 layers representing one map, which leads to confusion in the<br>
> >> >> layer<br>
> >> >> > switcher control.<br>
> >> >> ><br>
> >> >> > I read over the code of Layer.WMS, which inherits from Layer.Grid<br>
> >> and<br>
> >> >> also<br>
> >> >> > makes use of Tile.Image, but it's difficult to derive a solution<br>
> >> from<br>
> >> >> it,<br>
> >> >> > since all the request/response handling is already integrated into<br>
> >> the<br>
> >> >> > layer. Furthermore, WMS simply responds with tile images, whereas I<br>
> >> >> have<br>
> >> >> > to<br>
> >> >> > deal with an xml response.<br>
> >> >> ><br>
> >> >> > Any ideas how I could implement my layer?<br>
> >> >> ><br>
> >> >> > kind regards,<br>
> >> >> ><br>
> >> >> > Franz<br>
> >> >> > _______________________________________________<br>
> >> >> > Users mailing list<br>
> >> >> > <a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br>
> >> >> > <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
> >> >> ><br>
> >> >><br>
> >> >><br>
> >> >> --<br>
> >> >> Looking for flexible support on OpenLayers or GeoExt? Please check<br>
> >> out<br>
> >> >> <a href="http://www.osgis.nl/support.html" target="_blank">http://www.osgis.nl/support.html</a><br>
> >> >><br>
> >> >> Bart van den Eijnden<br>
> >> >> OSGIS<br>
> >> >> <a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a><br>
> >> >><br>
> >> >><br>
> >> ><br>
> >><br>
> >><br>
> >> --<br>
> >> Looking for flexible support on OpenLayers or GeoExt? Please check out<br>
> >> <a href="http://www.osgis.nl/support.html" target="_blank">http://www.osgis.nl/support.html</a><br>
> >><br>
> >> Bart van den Eijnden<br>
> >> OSGIS<br>
> >> <a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a><br>
> >><br>
> >><br>
> ><br>
><br>
><br>
> --<br>
> Looking for flexible support on OpenLayers or GeoExt? Please check out<br>
> <a href="http://www.osgis.nl/support.html" target="_blank">http://www.osgis.nl/support.html</a><br>
><br>
> Bart van den Eijnden<br>
> OSGIS<br>
> <a href="mailto:bartvde@osgis.nl" target="_blank">bartvde@osgis.nl</a><br>
><br>
><br>
</div></div>> <ATT00001..txt><br>
<br>
</blockquote></div></div></div><br>
</blockquote></div><br>