Dojo and OpenLayers mashup

4 messages Options
Embed this post
Permalink
Andre Steenveld

Dojo and OpenLayers mashup

Reply Threaded More More options
Print post
Permalink

Hello fellow JS programmers,

I have been working on integrating openlayers into a dojo widget. This widget can be configured with an XML file and can act and behave like a dojo widget as well as an instance of OpenLayers.Map. I am planning to write some code that makes it possible to configure the widget declaratively or via JSON.

This is all fine and well and works, with one very important exception. Panning does not work, more specific there are layers in which it doesn't work. Panning works in the Google layers because the drag and drop functionality is delegated to the Google layer. However for the "native" openlayers layers the events do fire but the map is not updated. Panning and then zooming in or out will cause the map to center on the correct point and so will panning and then resizing the window. It is not limited to a specific browser, I have tested FF3.5, IE8, IE7 emulation and Opera 10 all running on a windows XP box.
 
My hypothesis is that there is a mix up with some events that are attached via dijit._Widget and OpenLayers.Map, but I can't find exactly where or how to fix it properly.

If anyone has any suggestions at all I'd love to hear them. Any other feedback or suggestion are welcome as well. For a demo you can point the browser of your choice to http://bonsai.nmpo.nl/experiments/mapviewer.v2.html

For a zip file with the source, http://bonsai.nmpo.nl/experiments/viewer.zip. If you want to see more layers you can uncomment the layers in the XML file, they all work and have the data needed to fill them is supplied in the zip as well.

This message has been sent to the oplayers and dojo mailing lists.

Best regards, Andre Steenveld


_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Christopher Schmidt-2

Re: Dojo and OpenLayers mashup

Reply Threaded More More options
Print post
Permalink
On Fri, Nov 06, 2009 at 03:20:32PM +0100, Andre Steenveld wrote:
> My hypothesis is that there is a mix up with some events that are attached
> via dijit._Widget and OpenLayers.Map, but I can't find exactly where or how
> to fix it properly.
>
> If anyone has any suggestions at all I'd love to hear them. Any other
> feedback or suggestion are welcome as well. For a demo you can point the
> browser of your choice to
> http://bonsai.nmpo.nl/experiments/mapviewer.v2.html

My guess is that you have not configured your max extent and maxresolution
correctly. However, I can't test this, because I can't find where any
of the code that initailizes this map is, or how I can access the
OpenLayers.Map object from the console.

-- Chris

> For a zip file with the source, http://bonsai.nmpo.nl/experiments/viewer.zip.
> If you want to see more layers you can uncomment the layers in the XML file,
> they all work and have the data needed to fill them is supplied in the zip
> as well.
>
> This message has been sent to the oplayers and dojo mailing lists.
>
> Best regards, Andre Steenveld

> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users


--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Andre Steenveld

Re: Dojo and OpenLayers mashup

Reply Threaded More More options
Print post
Permalink
My guess is that you have not configured your max extent and maxresolution
correctly. However, I can't test this, because I can't find where any
of the code that initailizes this map is, or how I can access the
OpenLayers.Map object from the console.

-- Chris
 
 
You can find the OL object via the following code "dijit.byId( "map" )" this will return you the widget object which inherits from the OpenLayers.Map class. The code for this class can be found in the zip file in ./nmpo/geo/MapViewer.js The actual configuring happens from line 120 to 155. The configuration class can be found in ./nmpo/geo/Config.js wich parses the XML file and produces the layers, controls, config object and an additional config object.


_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Christopher Schmidt-2

Re: Dojo and OpenLayers mashup

Reply Threaded More More options
Print post
Permalink
On Fri, Nov 06, 2009 at 04:17:35PM +0100, Andre Steenveld wrote:

> >
> > My guess is that you have not configured your max extent and maxresolution
> > correctly. However, I can't test this, because I can't find where any
> > of the code that initailizes this map is, or how I can access the
> > OpenLayers.Map object from the console.
> >
> > -- Chris
> >
> >
>
> You can find the OL object via the following code "dijit.byId( "map" )" this
> will return you the widget object which inherits from the OpenLayers.Map
> class. The code for this class can be found in the zip file in
> ./nmpo/geo/MapViewer.js The actual configuring happens from line 120 to 155.
> The configuration class can be found in ./nmpo/geo/Config.js wich parses the
> XML file and produces the layers, controls, config object and an additional
> config object.

My theory was wrong. I don't have any other suggestions, sorry.

-- CHris
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users