<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19190"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=781212616-27032012>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=781212616-27032012></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>set always
mapOptions, if you use a projection other than EPSG:4326<SPAN
class=781212616-27032012>. Perhaps that solves your
problem.</SPAN><BR></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>mapOptions =
{<BR> projection: new
OpenLayers.Projection("EPSG:900913"),<BR> //displayProjection:
new OpenLayers.Projection("EPSG:4326"),<BR> units:
"m",<BR> numZoomLevels: 18,<BR>
maxResolution: 5,<BR> maxExtent: new
OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34,
20037508.34)<BR>};<BR>map = new OpenLayers.Map('map', mapOptions);</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=781212616-27032012></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=781212616-27032012>some layers with cities</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>var gphy = new
OpenLayers.Layer.Google(<BR> "Google
Physical",<BR> {type:
google.maps.MapTypeId.TERRAIN}<BR>);<BR>map.addLayer(gphy);</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>osmLayer = new
OpenLayers.Layer.OSM( "Simple OSM Map");<BR>map.addLayer(osmLayer);</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>esriTopo = new
OpenLayers.Layer.ArcGIS93Rest( "ESRI
Topo",<BR> "<A
href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?f=image">http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?f=image</A>",<BR>
{layers: "show:0"},
<BR>
{isBaseLayer:false,
visibility:false}<BR> );</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial>esriTopo.setVisibility(true);<BR>map.addLayers(esriTopo);<BR></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=781212616-27032012><FONT color=#0000ff
size=2 face=Arial>Arnd</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=781212616-27032012><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von </B>Ian
Dunlop<BR><B>Gesendet:</B> Dienstag, 27. März 2012 12:59<BR><B>An:</B>
openlayers-users@lists.osgeo.org<BR><B>Betreff:</B> [OpenLayers-Users] Shapefile
overlay on OSM or google<BR></FONT><BR></DIV>
<DIV></DIV>Hello,
<DIV><BR></DIV>
<DIV>I am trying to overlay a shapefile polygon on top of an Open Streetmap or
google layer. However, it only shows up when zoomed out and disappears
when zoomed in to the map. Any ideas why this would be happening? The shapefile
is being served by gesoserver and overlays correctly at all zoom levels on
another WMS layer eg </DIV>
<DIV>OpenLayers.Layer.WMS( "OpenLayers WMS", "<A
href="http://vmap0.tiles.osgeo.org/wms/vmap0"
target=_blank>http://vmap0.tiles.osgeo.org/wms/vmap0</A>", {layers: 'basic'}
);</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>I have only just started using openlayers so there may be something I am
missing. If this is not possible then are there any layers in the wild which
have city names on them (that's all I need really). Sample code
below:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV> var map = new
OpenLayers.Map('map');</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN> var
mapLayer = new OpenLayers.Layer.Google();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
//var mapLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN> //
"<A href="http://vmap0.tiles.osgeo.org/wms/vmap0"
target=_blank>http://vmap0.tiles.osgeo.org/wms/vmap0</A>", {layers: 'basic'}
);</DIV>
<DIV><BR></DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>var roads = new
OpenLayers.Layer.WFS(</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
"Roads", </DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
"<A href="http://localhost:8080/geoserver/wfs"
target=_blank>http://localhost:8080/geoserver/wfs</A>",</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
{typename: 'topp:tasmania_roads'},</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
{</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
typename: 'tasmania_roads', </DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
featureNS: '<A
href="http://www.openplans.org/topp"
target=_blank>http://www.openplans.org/topp</A>', </DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
extractAttributes: false</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
}</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>
map.addLayers([mapLayer, roads]);</DIV></DIV>
<DIV><BR></DIV>
<DIV>Cheers,</DIV>
<DIV><BR></DIV>
<DIV>Ian</DIV>
<DIV><BR></DIV>-- <BR>Ian Dunlop<BR>myGrid Team<BR>School of Computer
Science<BR>University of Manchester<BR></DIV></BODY></HTML>