[OpenLayers-Users] wfs markers without the redraw?

Brenningmeyer, Todd tbrenningmeyer at maryville.edu
Wed Aug 13 00:51:17 EDT 2008


Thanks Eric.  I'm including the html page.  Hopefully this will help.  I'm adding two WMS layers and then would like to add the markers layer to symbolize Greek villages that we surveyed several years ago.  Thanks again,
Todd
 
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="OpenLayers-2.6/theme/default/style.css" type="text/css" />     
    <script src="OpenLayers-2.6/lib/OpenLayers.js"></script>
    <script src="testStyleMap.js"></script>    
    <script src="OpenLayers-2.6/lib//Firebug/firebug.js"></script>    
    <script type="text/javascript">

        var map, selectControl, selectedFeature;
        var lon = 544134;
        var lat = 4183845;
        var zoom = 4;
        var Layer;
        function init(){
            map = new OpenLayers.Map( 'map', {
              maxResolution: 200,
              maxExtent: new OpenLayers.Bounds(426367,3991789,756976,4312918),
              units: 'm',
              projection: 'EPSG:32634'
              } );
              
            baseLayer = new OpenLayers.Layer.WMS( "Greece",
                    "http://localhost/cgi-bin/mapserv.exe", {                     
                     layers: "ocean,country,hillshade_mask,provinces_utm,roads_utm", 
                     map: "../htdocs/amap/amap.map",
                     transparent: "false",
                     format: "image/png" },
                     {singleTile: false} 
                     );
            labelLayer = new OpenLayers.Layer.WMS( "labels",
                    "http://localhost/cgi-bin/mapserv.exe", {                     
                     layers: "provinces_label", 
                     map: "../htdocs/amap/amaplabels.map",
                     transparent: "true",
                     format: "image/png" },
                     {singleTile: true} 
                     );                          
                             
           gmlLayer = new OpenLayers.Layer.GML( "villages",
                "http://localhost/cgi-bin/mapserv.exe",{
                map:"../htdocs/amap/sites_wfs.map",
                typename: "villages",
               outputformat: "gml2"}//
            );   
            var options = {
                hover: true,
                onSelect: feature_info
            };
            map.addLayers([baseLayer,labelLayer]);
            map.addLayer(gmlLayer);
            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
      map.addControl(new OpenLayers.Control.MousePosition());            
            map.addControl(panel);            
        }
    </script>
  </head>
  <body onload="init()">
    <div id="tags">
    </div>
    <div id="map"></div>
  <div id="info">
    <div id="feature_info">  
    <div id="panel"></div> 
    <div id="output"></div>            
  </body>
</html>
 

 

________________________________

From: Eric Lemoine [mailto:eric.c2c at gmail.com]
Sent: Tue 8/12/2008 11:30 PM
To: Brenningmeyer, Todd; users at openlayers.org
Subject: Re: [OpenLayers-Users] wfs markers without the redraw?



Hi. Have you added the layer to the map? If so you'll have to share
more code so that we can help you debug that one. Cheers. Eric

2008/8/13, Brenningmeyer, Todd <tbrenningmeyer at maryville.edu>:
> Thanks Eric.  I got the getfeature request to work as a URL but the script
> fails in openlayers in SetMap at
> "this.renderer.setSize(this.map.getSize());"  GetSize is undefined when I
> use GML rather than WFS.  Do you have any ideas how to set the getsize or
> why it would fail here under GML but not with WFS?  The syntax I'm using is:
>            gmlLayer = new OpenLayers.Layer.GML( "villages",
>                 "http://localhost/cgi-bin/mapserv.exe",{
>                 map:"../htdocs/amap/sites_wfs.map",
>                 typename: "villages",
>                outputformat: "gml2"});
> If you have any ideas please let me know and thanks again for your help.
> Todd
>
> ________________________________
>
> From: Eric Lemoine [mailto:eric.c2c at gmail.com]
> Sent: Tue 8/12/2008 3:31 PM
> To: Brenningmeyer, Todd; users at openlayers.org
> Subject: Re: [OpenLayers-Users] wfs markers without the redraw?
>
>
>
> Hi. You can use OpenLayers.Layer.GML but you'll need to have the
> appropriate params in the url to make the request an actual GetFeature
> request. Eric
>
> 2008/8/12, Brenningmeyer, Todd <tbrenningmeyer at maryville.edu>:
>> Hi,
>>
>> I've been trying to sort out exactly how to display my point data and
>> really
>> appreciate the help on the use of stylemaps vs. slds etc.  I have a
>> related
>> but slightly different question that I've been trying to sort out via the
>> online help and list serve archives etc. but am not getting very far.  I
>> have a series of sites in postGIS and am currently displaying these as wfs
>> data.  The data loads somewhat slowly but the issue is that it refreshes
>> or
>> redraws each time the user zooms in or out.  In my last attempt I
>> converted
>> the wfs data to markers but it still refreshes during each zoom and
>> sometimes during the pan.  Is there a way to avoid the redraw using wfs?
>> What is the best solution for serving about 200+ points?  Do I need to
>> load
>> the markers from a textfile to avoid the redraw or is there a very simple
>> solution that I've probably overlooked?  I've seen several questions about
>> speed of wfs for 300+ features but I'm still not clear on the difference
>> in
>> the use and creation of markers vs. vector points.  If both are created
>> directly from postgis will they be forced to refresh or redraw in the same
>> way during a zoom?
>>
>> Thanks again for your help
>>
>> Todd
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
>





More information about the Users mailing list