I’d like to integrate OSM in GWT.
I found this library called gwt-openlayers, but I don’t understand how can I make it work with the OSM map.
Can anyone provide me a short example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make sure you inherit from gwt-openlayers by adding the following to your module file:
<inherits name='org.gwtopenmaps.openlayers.OpenLayers'/>Also make sure you bring in the OpenLayers javascript library and OpenStreetMap OpenLayers into your application by adding the following lines in “Application.html” page:
<script src="http://www.openlayers.org/api/OpenLayers.js"></script><script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>Then it should a simple thing to create a layer that uses open street maps:
OSM openStreetMap = OSM.Osmarender("Base Map");openStreetMap.setIsBaseLayer(true);MapWidget mapWidget = new MapWidget("350px", "350px");mapWidget.getMap().addLayer(openStreetMap);