[OpenLayers-Users] Shapefile overlay on OSM or google

Ian Dunlop ian.dunlop at manchester.ac.uk
Tue Mar 27 06:58:42 EDT 2012


Hello,

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
OpenLayers.Layer.WMS( "OpenLayers WMS", "
http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );

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:

                var map = new OpenLayers.Map('map');
        var mapLayer = new OpenLayers.Layer.Google();
         //var mapLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
        //    "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );

var roads = new OpenLayers.Layer.WFS(
                "Roads",
                "http://localhost:8080/geoserver/wfs",
                {typename: 'topp:tasmania_roads'},
                {
                    typename: 'tasmania_roads',
                    featureNS: 'http://www.openplans.org/topp',
                    extractAttributes: false
                }
            );
        map.addLayers([mapLayer, roads]);

Cheers,

Ian

-- 
Ian Dunlop
myGrid Team
School of Computer Science
University of Manchester
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120327/89f45086/attachment-0001.html


More information about the Users mailing list