<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Perhaps. I still feel more at ease with JavaScript, however goofy, than
with SVG/VML. Im not sure what kind of DOM-tree Canvas/Excanvas
produce, but I would guess it to be easier to access than SVG/VML
elements. That is one of the things I would like to do: access the map
elements within the Canvas element *after* it has been loaded from a
MapServer server.<br>
<br>
<br>
<br>
Dan Little wrote:
<blockquote cite="mid:452252.17869.qm@web51402.mail.re2.yahoo.com"
 type="cite">
  <pre wrap="">I think there is some problems with the Canvas implementations across the different browsers.  I've actually done quite a bit of work using the Canvas and the exCanvas extension from Google.  While exCanvas SAYS it is a 100% implementation for IE there tends to be a number of quirks when it comes to actually placing objects in a drawing stack, animating them, or simply clearing the canvas at a predictable point.

Also, I think it would be much more to the benefit to simply have a VML output.  A little bit of browser sniffing is easy to do with any JS application (or even some server side scripting) and you'd be outputting either SVG or VML in that browser's native preferred format.  No goofy javascript library required.



----- Original Message ----
  </pre>
  <blockquote type="cite">
    <pre wrap="">From: Brent Fraser <a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com">&lt;bfraser@geoanalytic.com&gt;</a>
To: Jan Hartmann <a class="moz-txt-link-rfc2396E" href="mailto:j.l.h.hartmann@uva.nl">&lt;j.l.h.hartmann@uva.nl&gt;</a>
Cc: <a class="moz-txt-link-abbreviated" href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a>
Sent: Tuesday, January 27, 2009 9:07:32 AM
Subject: Re: [mapserver-dev] Canvas support for MapServer

Jan,

So your thought is to have MapServer generate something like (hacked from the 
example on <a class="moz-txt-link-freetext" href="https://developer.mozilla.org/en/Canvas_tutorial/Basic_usage">https://developer.mozilla.org/en/Canvas_tutorial/Basic_usage</a>):







  



Sure, it could be done.  One way is to write another output driver for 
Mapserver.  Another is to use some server-side scripting to ingest Mapserver's 
SVG and change into JavaScript-canvas code like that above. A performance hit, 
but at least it would be on the server side, and it might be a good way to 
prototype the Mapserver driver.

Brent

Jan Hartmann wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi Brent,

First let me say that Canvas support is just an idea; I think it can be done 
      </pre>
    </blockquote>
    <pre wrap="">but whether it is advisable to do so is up to you to decide. I liked the idea 
because the Canvas element is supported nowadays by most browsers, unlike SVG 
which needs a plugin. It is also much simpler, so it's easier to use for simple 
maps, and especially for simple interactive operations like digitizing, or 
combining server-side with client-side graphics. That's why I would prefer 
Canvas above SVG, let alone the fact that I much prefer to program in native 
Javascript above parsing XML. Most of my maps are simple (I would guess that 
goes for many people here), so SVG is decidedly overkill. The Canvas HTML 
element also fits nicely in the page layout and can be processed easily by 
web-editors.
    </pre>
    <blockquote type="cite">
      <pre wrap="">Your suggestion that Canvas could be implemented at the client side by 
      </pre>
    </blockquote>
    <pre wrap="">catching SVG output and transforming it into Canvas directives is certainly 
viable. That is also Paul Spencer's view in his reply to my email.  Yet I would 
prefer a server-side approach: it's more efficient (no second parsing of SVG 
code that had to be generated in the first place), and I think the server-side 
code can be easily adapted from the SVG driver. Canvas is a very simple format, 
just a few graphic primitives, more like GD than SVG actually.
    </pre>
    <blockquote type="cite">
      <pre wrap="">Again, I don't know how difficult it would be to add a Canvas outputformat, 
      </pre>
    </blockquote>
    <pre wrap="">and whether it fits at all into the MapServer design philosophy. However, when 
it could be done, it would give me an a far more easier tool than SVG  to 
combine server-side and client-side mapping.
    </pre>
    <blockquote type="cite">
      <pre wrap="">Jan

Brent Fraser wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Jan,

 My interest is in building a (or re-purposing an existing) tool for 
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">Cartographic Layout, for printing or rendering a graphics format for easy 
viewing (e.g. PDF).  Steve's comments were about using existing Web formats and 
syntax to describe the layout, and existing(?) web editors to do the 
placement/moving of the layout components.
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap=""> My (very limited) understanding of the HTML tag is that it's a 
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">"container" recognized by the browser, and vector (and raster) graphics are 
rendered into it using client-side JavaScript.  Sort of the JavaScript 
equivalent of the SVG format.
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap=""> It would be possible to add another output format to Mapserver to generate 
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">JavaScript code of canvas rendering methods, but a more elegant approach might 
be to write a small(?) JavaScript module to ingest Mapserver's SVG and render 
the objects to the canvas.
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap=""> Are there some specific features of the direct-canvas-output approach not 
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">available in SVG that you need?
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">Brent Fraser


Jan Hartmann wrote:
        </pre>
        <blockquote type="cite">
          <pre wrap="">Hi folks,

A few weeks ago I suggested in a thread about PDF support that Mapserver 
          </pre>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap="">could perhaps be made to support the new "Canvas" tag. There were no reactions 
to this, so I don't know if this suggestion is viable/advisable/practicable, or 
just downright stupid. Can anyone comment? (from 
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/pipermail/mapserver-dev/2009-January/008055.html">http://lists.osgeo.org/pipermail/mapserver-dev/2009-January/008055.html</a>)
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">I am wondering if MapServer support for the "Canvas" tag could do what 
            </pre>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap="">Steve suggests in a more simple way. Originally, only Safari, Opera and Firefox 
supported this tag to allow (simple) 2D drawing, but recently a surprisingly 
simple Javascript interface for IE has become available, translating Canvas 
command to native IE VRML commands. It requires just one single script tag in 
the web page.
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">See the tutorial at the Mozilla site at: 
            </pre>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap=""><a class="moz-txt-link-freetext" href="https://developer.mozilla.org/en/Canvas_tutorial">https://developer.mozilla.org/en/Canvas_tutorial</a>
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">and the IE interface (from the Google stables) at: 
            </pre>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap=""><a class="moz-txt-link-freetext" href="http://excanvas.sourceforge.net/">http://excanvas.sourceforge.net/</a>
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">This is something I have long been looking for. The graphics are very 
            </pre>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap="">simple, so the functionality is nothing like PDF or SVG, but I could imagine 
that a driver for MapServer could fulfill many needs. I can use it already by 
letting Mapserver generate raw coordinates and catching them with some sort of 
Ajax, but a separate driver would be very neat of course.
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">How about it?

Jan


            </pre>
          </blockquote>
          <pre wrap="">------------------------------------------------------------------------

_______________________________________________
mapserver-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a>
          </pre>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap="">_______________________________________________
mapserver-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->


      

  </pre>
</blockquote>
</body>
</html>