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