From: Edwin C. <com...@gm...> - 2010-05-02 20:51:19
|
Hi Hans, Did you try the suggestions by Jon Britton? Appararently he got it working with the latest snapshot (see gwt-ol website for link). I found an older post by Carsten in the mailing list who got OSM working as well and gave some example code. The wrapper code is just a very thin, easy to understand layer (have a look at some of the Layer classes), so if you know how it works in Javascript it should be a small step to work out how it works in GWT, or how it should work in GWT. If I look at the OpenLayers code for a simple OSM map (http://openlayers.org/dev/examples/) it should be as easy to add an OSM layer to the map as: layer = new OpenLayers.Layer.OSM( "Simple OSM Map"); map.addLayer(layer); However, if I look at the OSM implementation in GWT-OL it is returning an OSM layer like this: return new $wnd.OpenLayers.Layer.OSM.Mapnik(name) This is a constructor as it appears in http://www.openstreetmap.org/openlayers/OpenStreetMap.js, which calls the plain OSM constructor, but adds some extra (perhaps unwanted) options. It is unclear to me at this point, when to use or when not to use the 'OpenStreetMap.js' code. This dependency is not in any of the current OpenLayers examples I could find on http://openlayers.org/dev/examples/, and I always found it a bit murky why OSM is hosting their own little library on top of OpenLayers instead of contributing it to OL core. The advanced OSM examples of OpenLayers are not even using OSM for the rasters, but a WMS layer portraying OSM data. Possibly, this is necessary to do the advanced features, but even if you just want the OSM layers as background you could consider adding them as WMS layers as in the Advanced OSM example. If anybody knows what is the present best way to use OSM with OpenLayers please let me know. I guess we do not want to break code that already depends on the existing OSM, but we do want to get up-to-date. Greetings, Edwin Commandeur 2010/5/2 Hans Terje Møller <han...@ho...>: > Hi. > > I worte to you a few weeks ago about using OSM in gwt-openlayers. Do you > know about someone in your development group that could help me understand > how to use the OSM class? > If you do, please send me their e-mail adress. > > Thanks in advance! > > Regards, > Hans Terje Møller > |