Dojo and OpenLayers mashup

View: New views
2 Messages — Rating Filter:   Alert me  

Dojo and OpenLayers mashup

by Andre Steenveld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Parent Message unknown Re: [OpenLayers-Users] Dojo and OpenLayers mashup

by Andre Steenveld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest