<!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>&nbsp;</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>&nbsp;&nbsp;&nbsp; projection: new 
OpenLayers.Projection("EPSG:900913"),<BR>&nbsp;&nbsp;&nbsp; //displayProjection: 
new OpenLayers.Projection("EPSG:4326"),<BR>&nbsp;&nbsp;&nbsp; units: 
"m",<BR>&nbsp;&nbsp;&nbsp; numZoomLevels: 18,<BR>&nbsp;&nbsp;&nbsp; 
maxResolution: 5,<BR>&nbsp;&nbsp;&nbsp; maxExtent: new 
OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 
20037508.34)<BR>};<BR>map = new OpenLayers.Map('map', mapOptions);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=781212616-27032012></SPAN></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>var gphy = new 
OpenLayers.Layer.Google(<BR>&nbsp;&nbsp;&nbsp; "Google 
Physical",<BR>&nbsp;&nbsp;&nbsp; {type: 
google.maps.MapTypeId.TERRAIN}<BR>);<BR>map.addLayer(gphy);</FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>esriTopo = new 
OpenLayers.Layer.ArcGIS93Rest( "ESRI 
Topo",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{layers: "show:0"}, 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{isBaseLayer:false, 
visibility:false}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</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. &nbsp;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&nbsp;</DIV>
<DIV>OpenLayers.Layer.WMS( "OpenLayers WMS",&nbsp;"<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). &nbsp;Sample code 
below:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var map = new 
OpenLayers.Map('map');</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; var 
mapLayer = new OpenLayers.Layer.Google();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
//var mapLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; // 
&nbsp; &nbsp;"<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>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;"Roads",&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;"<A href="http://localhost:8080/geoserver/wfs" 
target=_blank>http://localhost:8080/geoserver/wfs</A>",</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;{typename: 'topp:tasmania_roads'},</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;{</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;typename: 'tasmania_roads',&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;featureNS: '<A 
href="http://www.openplans.org/topp" 
target=_blank>http://www.openplans.org/topp</A>',&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;extractAttributes: false</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;}</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp;);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap"></SPAN>&nbsp; &nbsp; &nbsp; 
&nbsp;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>