[OpenLayers-Users] First try with html5 canvas for layers

Christopher Schmidt crschmidt at metacarta.com
Fri Nov 20 20:22:48 EST 2009


On Sat, Nov 21, 2009 at 01:54:15PM +1300, Adam Ratcliffe wrote:
> Hi Kris,
> 
> I'm fairly new to OpenLayers and assumed that when creating a vector
> layer for use with wfs-t that the layer features would be rendered
> using either SVG or VML, thus allowing for the full range of mouse
> interactions that other DOM elements support (click, mouseover,
> mouseout etc).
> 
> With the canvas implementation how do you support edting of a polygon
> for instance?

NOte that there is already a canvs drawing implementation in OpenLayers
that fully supports drawing, editing, feature selection, etc. (It works
by reimplementing all of the features of these functionalities that
exist in SVG at the browser level in OpenLayers.) 

-- Chris

> Cheers
> Adam
> 
> On Sat, Nov 21, 2009 at 1:32 PM, Kris Geusebroek <kgeusebroek at xebia.com> wrote:
> > Hi Adam,
> >
> > I think it doesn't make a difference in the current way OpenLayers works
> > other then replacing a lot of div's by a single canvas. Nothing to do
> > with interactivity I guess.
> >
> > The current div based vector layer can be used together with wfs-t or
> > getfeatureinfo request to make it interactive.
> >
> > And together with the refresh strategy (in trunk) you can make it look
> > like you are following the changes in data near real time.
> >
> >
> > Perhaps I misunderstood your remark. If so feel free to contact me
> >
> > Cheers Kris
> >
> > -----Original Message-----
> > From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> > On Behalf Of Adam Ratcliffe
> > Sent: Saturday, November 21, 2009 12:45 AM
> > To: users at openlayers.org
> > Subject: Re: [OpenLayers-Users] First try with html5 canvas for layers
> >
> > Hi Kris,
> >
> > Am I correct in thinking this technique would be useful for displaying
> > read-only vector data only?  Or are you considering an approach such
> > as overlaying a transparent image map to allow interactivity?
> >
> > Cheers
> > Adam
> >
> > On Thu, Nov 19, 2009 at 8:58 PM, Kris Geusebroek <kgeusebroek at xebia.com>
> > wrote:
> >> Hi Eric,
> >>
> >> Indeed it's cool, thanks.
> >> My goal was to write an application with open source technologies to
> >> track cars driving around.
> >> I wrote a prototype with geoserver and openlayers and this was
> >> succesfull. The big problem was the memory consumption (especially in
> >> IE) because of the large amount of DOM manipulation that is done when
> >> panning and zooming and drawing vector's (the cars, with fills,
> > stroke,
> >> label etc.)
> >>
> >> Since using a plugin is out of the question here I began investigating
> >> the html5 canvas.
> >> I know it's not supported in IE, but for me that was a good thing
> >> because it gave me the opportunity to have the client choose a
> > different
> >> browser then IE.
> >>
> >> My plans for the future of the app is to also use workers and the
> >> browser database (to be able to store historical responses clientside
> > to
> >> draw a route the car has followed for the last 10 minutes or so)
> >>
> >> Also I think the canvas gives us the opportunity to create a print
> >> control or a save map as, because in the end it's just an image. (have
> >> to combine the layer specific canvasses into one but that's easy ;-))
> >>
> >> If you have any other ideas or see different opportunities let me
> > know,
> >> my client is fundning me to experiment with html5 so I might be able
> > to
> >> spent some time on other's feature requests ;-)
> >>
> >> Cheers Kris
> >>
> >>
> >> -----Original Message-----
> >> From: Eric Lemoine [mailto:eric.lemoine at camptocamp.com]
> >> Sent: Thursday, November 19, 2009 6:53 AM
> >> To: Kris Geusebroek
> >> Cc: OpenLayers Users
> >> Subject: Re: [OpenLayers-Users] First try with html5 canvas for layers
> >>
> >> On Wednesday, November 18, 2009, Kris Geusebroek
> > <kgeusebroek at xebia.com>
> >> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Hi All,
> >>>
> >>>
> >>>
> >>> I'm currently investigating the
> >>> possibilities of integrating html5 functionality into openlayers.
> >>>
> >>> My first try is using canvas for a layer
> >>> instead of div's
> >>>
> >>>
> >>>
> >>> I've setup a sandbox which you can
> >>> use to have a look:
> >>
> > http://dev.openlayers.org/sandbox/krisgeus/openlayers/examples/tilecache
> >> Canvas.html
> >>>
> >>>
> >>>
> >>> This is the first example to show it's
> >>> possible ;-). Only features now are zoom and pan without the resize
> >> transition effect.
> >>>
> >>> If anyone has remarks, ideas, feature
> >>> requests, help offerings etc. Feel free to contact me.
> >>
> >> This is cool!
> >>
> >> May I ask what's your goal with displaying tiles using canvas? Is it
> >> performance? I have never played with canvas so I'm interested to know
> >> and talk about what it can bring to OpenLayers.
> >>
> >> Thanks Kris,
> >>
> >> --
> >> Eric Lemoine
> >>
> >> Camptocamp France SAS
> >> Savoie Technolac, BP 352
> >> 73377 Le Bourget du Lac, Cedex
> >>
> >> Tel : 00 33 4 79 44 44 96
> >> Mail : eric.lemoine at camptocamp.com
> >> http://www.camptocamp.com
> >> _______________________________________________
> >> Users mailing list
> >> Users at openlayers.org
> >> http://openlayers.org/mailman/listinfo/users
> >>
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list