[OpenLayers-Users] Blank WMS tiles displaying over Bing hybrid
layer
Marc Jansen
jansen at terrestris.de
Tue Jun 15 04:44:43 EDT 2010
Hi Chris,
just some notes:
On 12.06.2010 19:04, Chris Lam wrote:
> Hello,
>
>
[shortened]
> Here is my mapserver request URL from one tile:
>
> http://localhost/cgi-bin/mapserv.exe?MAP=C%3A%2Fms4w%2Fapps%2FLB_MAPFILES%2FPARCELS_MAPFILE.map&LAYERS=PARCELS_URL_pol&TRANSPARENT=true&DISPLAYPROJECTION=EPSG%3A4326&ISBASELAYER=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A900913&BBOX=-13719529.331192,6352222.7966734,-13718306.33874,6353445.7891258&WIDTH=256&HEIGHT=256
>
>
Please try to enable DEBUG for your mapserver:
http://mapserver.org/mapfile/map.html (DEBUG). Be sure to read the log
and -- furthermore -- set the URL-Param EXCEPTIONS to
"application/vnd.ogc.se_inxml".
> Here is my relevant code:
>
> function init () {
> //Configure map
> var options = {
> projection: new OpenLayers.Projection("EPSG:900913"),
> units: "m",
> maxResolution: 156543.0339
> maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
> 20037508.34, 20037508.34)};
> //Create new map object
> var map = new OpenLayers.Map('map',options);
> //Add a layerswitcher
> map.addControl(new OpenLayers.Control.LayerSwitcher());
> //Add the Bing map base layer
> var vemap = new OpenLayers.Layer.VirtualEarth("Virtual Earth",
> { type: VEMapStyle.Hybrid,
> sphericalMercator: true,
> numZoomLevels: 21,
> maxExtent: new
> OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
> });
> //Add the WMS parcels overlay layer
> var parcels_wms = new OpenLayers.Layer.WMS(
> "Lions Bay Parcels",
> "http://localhost/cgi-bin/mapserv.exe?",
> {
> map: 'C:/ms4w/apps/LB_MAPFILES/PARCELS_MAPFILE.map',
> layers: 'PARCELS_URL_pol',
> transparent: 'true',
> displayProjection: new
> OpenLayers.Projection("EPSG:4326"),
> isBaseLayer: false,
> maxExtent: new
> OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)},
> {
> visibility:false
> }
> );
>
Do not include the key-value-pairs
transparent: 'true',
displayProjection: new
OpenLayers.Projection("EPSG:4326"),
isBaseLayer: false,
maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
within the third parameter of OpenLayers.Layer.WMS. They end up in the
URL to the maposerver in question and are very likely ignored.
I would guess that indeed you are experiencing a mapserver problem. Try
to ask over on their list about how to get mapserver to the point that
it serves maps in 900913.
Hope that helps,
Marc
> //Add the layers to the map object
> map.addLayers([vemap,parcels_wms]);
> //Center the map over the study area
> map.setCenter(new OpenLayers.LonLat(-13718569,6353226), 14);
>
> ...the rest of the code is other map controls, layer opacity adjuster, and
> single-click mouse event handler containing a getfeatureinfo request.
>
> This code seems to be fine, but am I doing something wrong with setting max
> extent or max resolution? The Bing map itself centers and zooms the way I
> want, but the WMS data is failing to align with it. Perhaps it could be
> displayed outside of the extents and therefore not rendered at all? Or is
> this a mapserver problem where my server is not requesting tiles in
> epsg:900913 to align with Bing tiles? In another web template where I have
> not implemented the links to Bing maps, my wms layer displays fine since the
> map projection is 4326 and not 900913. That template has a line of code
> map.zoomToMaxExtent(); that, when commented out, makes the working overlay
> disappear completely. Don't know if that is a helpful clue.
>
> I have tried starting from a basic html template to add code line by line to
> isolate the problem. It works fine until I add the Bing layer which just
> wipes out the previously displayed WMS parcel layer to just display the Bing
> hybrid with the overlay present, but rendered completely as blank 256x256
> tiles.
>
> Thank you for any advice, for I am out of leads!
>
> Regards,
>
> Chris Lam
>
> P.S. If this is a duplicate posting, you have my sincere apologies for the
> lapse in etiquette. At the time of this message, I was not subscribed to
> the mailing list and I think you have to be for messages to be accepted.
> Also I did not see my message in the users archive or on the Nabble forum
> where I found this list. Thank you for your understanding.
>
--
.................................................................
Im April erschienen:
OpenLayers - Webentwicklung mit dynamischen Karten und Geodaten
von M. Jansen und T. Adams, OpenSourcePress, München.
ISBN: 978-3-937514-92-5
URL: http://openlayers-buch.de
.................................................................
Dipl.-Geogr. Marc Jansen
- Anwendungsentwickler -
terrestris GmbH& Co. KG
Irmintrudisstraße 17
53111 Bonn
Tel: ++49 (0)228 / 96 28 99 -53
Fax: ++49 (0)228 / 96 28 99 -57
Email: jansen at terrestris.de
Web: http://www.terrestris.de
Amtsgericht Bonn, HRA 6835
Komplementärin: terrestris Verwaltungsgesellschaft mbH
vertreten durch: Hinrich Paulsen, Till Adams
More information about the Users
mailing list