You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by datazuul <ra...@pixotec.de> on 2012/03/30 23:00:13 UTC
Wicketstuff - Openlayers: not working with wicket 1.5.5?
Hi I tried to embed an openstreetmap in my page with the code from
SimpleOpenStreetMapPage (wicketstuff openlayers example):
final List<Layer> layers = new ArrayList<Layer>();
final Layer layerOSMTilesAtHome = new OSM("Osmarender",
OSMLayer.TilesAtHome);
final Layer layerOSMMapnik = new OSM("Mapnik", OSMLayer.Mapnik);
final Layer layerOSMCycleMap = new OSM("CycleMap", OSMLayer.CycleMap);
layers.add(layerOSMMapnik);
layers.add(layerOSMTilesAtHome);
layers.add(layerOSMCycleMap);
final HashMap<String, String> mapOptions = new HashMap<String, String>();
final Bounds boundsExtend = new Bounds(new LonLat(-20037508.34,
-20037508.34), new LonLat(20037508.34,
20037508.34));
mapOptions.put("maxExtent", boundsExtend.getJSconstructor());
mapOptions.put("projection", "new OpenLayers.Projection('EPSG:900913')");
mapOptions.put("displayProjection", "new
OpenLayers.Projection('EPSG:4326')");
mapOptions.put("units", "'meters'");
mapOptions.put("maxResolution", "156543");
mapOptions.put("numZoomLevels", "18");
final OpenLayersMap map = new OpenLayersMap("map", true, layers,
mapOptions);
map.addControl(Control.LayerSwitcher);
map.addControl(Control.MousePosition);
map.addControl(Control.KeyboardDefaults);
// map.setCenter(new LonLat(10.2, 48.9));
// map.setZoom(3);
add(map);
but nothing is rendered.
Javascript error:
Error: OpenLayers.Layer.OSM.Osmarender is not a constructor
Line: var osm26507926 =new OpenLayers.Layer.OSM.Osmarender('Osmarender');
Anyone using OpenLayersMap and knows how to get it working?
(I already tried this fix, mentioned by another user:
private static final String OPEN_LAYERS_VERSION = "2.11"; in OpenLayersMap,
didn't help)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicketstuff-Openlayers-not-working-with-wicket-1-5-5-tp4520366p4520366.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicketstuff - Openlayers: not working with wicket 1.5.5?
Posted by Michael Allan <mi...@zelea.com>.
> final Layer layerOSMTilesAtHome = new OSM("Osmarender",
> OSMLayer.TilesAtHome);
The "Osmarender" renderer became unavailable recently (not sure why).
Comment out the lines that refer to it, and to "layerOSMTilesAtHome".
This has nothing to do with Wicket.
--
Michael Allan
Toronto, +1 416-699-9528
http://zelea.com/
datazuul said:
> Hi I tried to embed an openstreetmap in my page with the code from
> SimpleOpenStreetMapPage (wicketstuff openlayers example):
>
> final List<Layer> layers = new ArrayList<Layer>();
>
> final Layer layerOSMTilesAtHome = new OSM("Osmarender",
> OSMLayer.TilesAtHome);
> final Layer layerOSMMapnik = new OSM("Mapnik", OSMLayer.Mapnik);
> final Layer layerOSMCycleMap = new OSM("CycleMap", OSMLayer.CycleMap);
>
> layers.add(layerOSMMapnik);
> layers.add(layerOSMTilesAtHome);
> layers.add(layerOSMCycleMap);
>
> final HashMap<String, String> mapOptions = new HashMap<String, String>();
> final Bounds boundsExtend = new Bounds(new LonLat(-20037508.34,
> -20037508.34), new LonLat(20037508.34,
> 20037508.34));
> mapOptions.put("maxExtent", boundsExtend.getJSconstructor());
> mapOptions.put("projection", "new OpenLayers.Projection('EPSG:900913')");
> mapOptions.put("displayProjection", "new
> OpenLayers.Projection('EPSG:4326')");
> mapOptions.put("units", "'meters'");
> mapOptions.put("maxResolution", "156543");
> mapOptions.put("numZoomLevels", "18");
>
> final OpenLayersMap map = new OpenLayersMap("map", true, layers,
> mapOptions);
>
> map.addControl(Control.LayerSwitcher);
> map.addControl(Control.MousePosition);
> map.addControl(Control.KeyboardDefaults);
>
> // map.setCenter(new LonLat(10.2, 48.9));
> // map.setZoom(3);
>
> add(map);
>
> but nothing is rendered.
>
> Javascript error:
> Error: OpenLayers.Layer.OSM.Osmarender is not a constructor
> Line: var osm26507926 =new OpenLayers.Layer.OSM.Osmarender('Osmarender');
>
> Anyone using OpenLayersMap and knows how to get it working?
>
> (I already tried this fix, mentioned by another user:
> private static final String OPEN_LAYERS_VERSION = "2.11"; in OpenLayersMap,
> didn't help)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org