<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<P>Hi all,</P>
<P>In the follwing example we add two layers, one a vector layer, and a marker layer.</P>
<P>The both layers appear in the layer switcher, but only the marker layer shows the marker.</P>
<P>The vector layer displays nothing. Any ideas ?</P>
<P><FONT face=Verdana size=2> public static native void addVectorLayer( JSObject map ) /*-{<BR> var point = new $wnd.OpenLayers.Geometry.Point(-20256.01492, 7063863.68047);<BR> var pointFeature = new $wnd.OpenLayers.Feature.Vector(point);<BR> var vectorLayer = new $wnd.OpenLayers.Layer.Vector("Simple Geometry");<BR> map.addLayer(vectorLayer);<BR> vectorLayer.addFeatures([pointFeature]);<BR> <BR> $wnd.alert("got here 1");<BR> <BR> var size = new $wnd.OpenLayers.Size(10,17);<BR> var offset = new $wnd.OpenLayers.Pixel(-(size.w/2), -size.h);<BR> var icon = new $wnd.OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,offset);<BR> var markers = new $wnd.OpenLayers.Layer.Markers( "Markers" );<BR> markers.addMarker(new $wnd.OpenLayers.Marker(new $wnd.OpenLayers.LonLat(-20256.01492, 7063863.68047),icon));<BR> map.addLayer(markers);<BR> <BR> $wnd.alert("got here 2");<BR> <BR> }-*/;</FONT></P>
<DIV><FONT face=Verdana color=#000000 size=2>I have tried this with both openlayers 2.6 and 2.7</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>ps the map options for this map are:</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2> private static MapOptions getMapOptions() {<BR> Bounds MAP_BOUNDS = new Bounds( -829329, 6179586, 272732, 8275651 );<BR> MapOptions mapOptions = new MapOptions();<BR> mapOptions.setControls( new JObjectArray( new JSObject[] {} ) );<BR> mapOptions.setNumZoomLevels( 19 );<BR> mapOptions.setProjection( "EPSG:900913" );<BR> mapOptions.setAttribute( "units", "m" );<BR> mapOptions.setAttribute( "maxExtent", MAP_BOUNDS.getJSObject() );<BR> mapOptions.setAttribute( "maxResolution", 8187.752976562511D );<BR> return mapOptions;<BR> }</FONT></DIV></BODY></HTML>