[OpenLayers-Dev] GML Layers is no more visible in vector
sandbox revision 2823
Christine Spietz
spietz at fh-bingen.de
Thu Mar 22 07:36:22 EDT 2007
Hi again,
I took a look at the http://openlayers.org/dev/examples/ especially at the
gml-layer-example.
The GML-layer displays the polygon.xml and may also display the other files
in http://openlayers.org/dev/examples/gml/. I get a response of my WFS which
looks like this:
<wfs:FeatureCollection xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengeospatial.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver
https://www.flo.rlp.de/mapserv?map=gazetteer.map&SERVICE=WFS&SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=schlag_box&OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="epsg:31467">
<gml:coordinates>
3407301.115000,5507652.775000 3409374.573000,5512980.496000
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ms:schlag_box>
<gml:boundedBy>
<gml:Box srsName="epsg:31467">
<gml:coordinates>
3407802.158000,5512683.680000 3408109.996000,5512980.496000
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="epsg:31467">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>
3407867.940000,5512748.922000 3407881.750000,5512721.861000
3407888.890000,5512716.341000 3408047.394000,5512683.680000
3408052.984000,5512687.700000 3408065.415000,5512780.432000
3408109.966000,5512798.002000 3408109.996000,5512803.212000
3408078.155000,5512816.252000 3407998.713000,5512878.844000
3407971.482000,5512919.865000 3407970.602000,5512960.705000
3407966.822000,5512968.965000 3407953.602000,5512979.856000
3407945.481000,5512980.496000 3407810.388000,5512900.355000
3407803.118000,5512889.415000 3407802.158000,5512880.515000
3407807.188000,5512865.754000 3407825.288000,5512840.994000
3407823.338000,5512837.034000 3407837.569000,5512817.553000
3407844.819000,5512802.883000 3407867.940000,5512748.922000
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ms:msGeometry>
<ms:SLNR>0001</ms:SLNR>
<ms:SUNA>0</ms:SUNA>
<ms:SUNG>0</ms:SUNG>
<ms:STYP> </ms:STYP>
<ms:JAHR>2007</ms:JAHR>
<ms:BTNR>0107133050580001</ms:BTNR>
<ms:SLFL>49133</ms:SLFL>
<ms:NUAR>311</ms:NUAR>
<ms:BENA>B</ms:BENA>
<ms:GEO_ID>6974205</ms:GEO_ID>
</ms:schlag_box>
</gml:featureMember>
.... //lot of featureMembers
</wfs:FeatureCollection>
So the structure is little bit different. May this perhaps be the cause,
that my GML-layer displays nothing?
Also I 'm still getting the curios error:
>>OpenLayers.MouseListener.MouseDefaults is not a constructor
>> var mouseListener = new OpenLayers.MouseListener.MouseDefaults();
>> in Map.js line 229.
I'm really convinced that I do not use the code which causes the error, so I
guessed it was an error in OpenLayers. But this also seems not to be the
case....
Here is my "whole" code (at least the code which contains OpenLayers
things). There really is no use of MouseDefaults in it. I really have no
idea what to do. My form has to be ready next week, so I'm really in a tight
spot. Perhaps I indeirectly use the MouseDefaults??
function initMap(){
map = new OpenLayers.Map($('map'), {projection: "EPSG:31467",maxExtent:
maxEBBOX,maxResolution: "auto",units: 'meters'});
var freedop_baselayer = new
OpenLayers.Layer.WMS.Untiled("FreeDOP","http://geo.service24.rlp.de/wmsconnector/com.esri.wms.Esrimap/RLP_FREEDOP?",{layers:"dop",format:"image/png",bgcolor:"0xffffff",transparent:"true"},
{isBaseLayer:true});
map.addLayers([freedop_baselayer]);
var geoportal_top_overlay_citiesnames= new
OpenLayers.Layer.WMS.Untiled("Ortsnamen","http://gdi.bkg.bund.de//cgi-bin/mapserv",{map:"/srv/www/htdocs/navigation_bkg_neu_2.map",layers:"ortsnamen_bdlm",JAHR:"2006",format:"image/png",bgcolor:"0xffffff",transparent:"true"},
{isBaseLayer:false});
var geoportal_top_overlay_street= new
OpenLayers.Layer.WMS.Untiled("Strassen","http://gdi.bkg.bund.de//cgi-bin/mapserv",{map:"/srv/www/htdocs/navigation_bkg_neu_2.map",layers:"ortsstrassen_bdlm,kreisstrassen_250,kreisstrassen_bdlm,landesstrassen_250,landesstrassen_bdlm,bundesstrassen_250,bundesstrassen_bdlm,autobahnen_dlm250,autobahnen_bdlm,landesgrenze_l",JAHR:"2006",format:"image/png",bgcolor:"0xffffff",transparent:"true"},
{isBaseLayer:false});
var geoportal_top_overlay_wald_see = new
OpenLayers.Layer.WMS.Untiled("Waelder/Seen/Ortslagen","http://gdi.bkg.bund.de//cgi-bin/mapserv",{map:"/srv/www/htdocs/navigation_bkg_neu_2.map",layers:"vegetation_1000,gewaesser_1000_l,gewaesser_dlm250_fl,binnengewaesser_bdlm,ortslage_bdlm",JAHR:"2006",format:"image/png",bgcolor:"0xffffff",transparent:"true"},
{isBaseLayer:false});
map.addLayers([geoportal_top_overlay_wald_see,geoportal_top_overlay_street,geoportal_top_overlay_citiesnames]);
var flo_overlay_kataster = new
OpenLayers.Layer.WMS.Untiled("Kataster","/agroConnect-Web/FLOrlpTineTunnel",{route:"https://www.flo.rlp.de/mapserver",map:"kataster.map",layers:"alk_ora",JAHR:"2006",format:"image/png",bgcolor:"0xffffff",transparent:"true"},
{isBaseLayer:false});
map.addLayers([flo_overlay_kataster]);
url="/agroConnect-Web/FLOrlpTineTunnel?getAllFeatures"; //URL to Servlet,
response = FeatureCollection
var schlaege = new OpenLayers.Layer.GML("Schlaege",url,{style: new
OpenLayers.Style({
strokeColor: "rgb(128,0,255)",strokeWidth: 3,strokeOpacity: 0.5,fillColor:
"rgb(100,100,255)",fillOpacity: 0.1,hoverStrokeColor: "red"})});
map.addLayer(schlaege);
map.zoomToMaxExtent();
regSelectField(map);
}
//----------------------------------------------
function regSelectField(map)
{
map.events.register('click', map, function (e) {
var
wfsCurrentURL="/agroConnect-Web/UpdateTineSelection?map=gazetteer.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=ms:schlag_box&BBOX="
var tolerance = new OpenLayers.Pixel(1, 1);
var min_px = new OpenLayers.Pixel(e.xy.x - tolerance.x, e.xy.y +
tolerance.y);
var max_px = new OpenLayers.Pixel(e.xy.x + tolerance.x, e.xy.y -
tolerance.y);
var min_ll = map.getLonLatFromPixel(min_px);
var max_ll = map.getLonLatFromPixel(max_px);
var url = wfsCurrentURL + min_ll.lon + ','+ min_ll.lat + ','+ max_ll.lon
+',' + max_ll.lat;
if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
// code for IE
if (window.ActiveXObject){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
if(xmlhttp!=null) {xmlhttp.open("GET",url,false);xmlhttp.send(null); }
drawGMLLayers();
});
}
//----------------------------------------------
function drawGMLLayers(){
if(single!=null)
map.removeLayer(single);
single= new OpenLayers.Layer.GML("Schlag",singleurl,{style: new
OpenLayers.Style({
strokeColor: "rgb(255,0,255)",strokeWidth: 3,strokeOpacity: 1.0,fillColor:
"rgb(255,0,255)",fillOpacity: 0.1,hoverStrokeColor: "red"})});
map.addLayer(single);
}
Regards
Christine
----- Original Message -----
From: "Christopher Schmidt" <crschmidt at metacarta.com>
To: "Christine Spietz" <spietz at fh-bingen.de>
Cc: <dev at openlayers.org>
Sent: Wednesday, March 21, 2007 12:43 PM
Subject: Re: [OpenLayers-Dev] GML Layers is no more visible in vector
sandbox revision 2823
> On Wed, Mar 21, 2007 at 08:49:59AM +0100, Christine Spietz wrote:
>> Hi Erik,
>>
>> I have updated to the libraries of
>> http://svn.openlayers.org/trunk/openlayers revision 2828, but now it's
>> working less then before.
>> I can not see any map anymore.
>> >----------------------------------->ERROR-MESSAGE>----------------------------------->
>> OpenLayers.MouseListener.MouseDefaults is not a constructor
>> var mouseListener = new OpenLayers.MouseListener.MouseDefaults();
>> in Map.js line 229.
>> >----------------------------------->END OF
>> >ERROR-MESSAGE>----------------------------------->
>>
>> The thing is: This line (mouseListener = ...) is not contained in Map.js
>> of
>> the actual trunk-version of OpenLayers. So I thought I might have
>> embedded
>> the wrong OpenLayers-folder in my page, but this is also not the case.
>>
>> Do you have an idea, what may have gone wrong? Is it a bug in the actual
>> trunk version or what else coul be the cause?
>
> Much of the code between the existing trunk and the old vector branch
> was refactored. http://openlayers.org/dev/examples/ has a list of
> examples -- including gml-layer and EditingToolbar -- that demonstrate
> the new functionality. Please refer to these examples for more
> information on how to get started with the trunk version of the vector
> tools.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
More information about the Dev
mailing list