Hi Alexandre,
 
   This is part 2 of my email response:
 
We take advantage of the tilecache for our static base layers.  (NOTE:  We'll definately use a Layer Group to make this part faster.)
 
  This is a global variable that we use to identify the "gwc":  var wmsURL = "/geoserver/gwc/service/wms?";
 
   Then we have this code to display our base layers:
 

GOVFAASUA.widgets.Map=Ext.extend(mapfish.widgets.MapComponent,{

id:'map',

layout:'fit',

region:'center',

border:false,

buttonAlign:'right',

baseToggled:false,

initComponent:function(){

// create WMS layer, let's render the world

// layers: 'SUA:world_adm',

// layers: 'sua_base',

var base = new OpenLayers.Layer.WMS(

"SUA base layer",

wmsURL,

{

layers: 'SUA:world_adm',

styles: 'world_adm_style',

srs: 'EPSG:4326',

format: 'image/png',

tiled: 'true',

bgcolor: '0xA6CAF0',

transparent: false

},

{

'opacity': 1.0,

'isBaseLayer': true,

'wrapDateLine': true,

'transitionEffect': true

}

);

// Now let's try local state shapes

var us_states = new OpenLayers.Layer.WMS(

"US States",

wmsURL,

{

layers: 'SUA:us_state',

srs: 'EPSG:4326',

format: 'image/png8',

tiled: 'true',

transparent: true

},

{

'isBaseLayer': false, 'wrapDateLine': true

}

);

// Now let's try major lakes (national) shapes

var us_lakes = new OpenLayers.Layer.WMS(

"Major Lakes National",

wmsURL,

{

layers: 'SUA:major_lake_national',

srs: 'EPSG:4326',

format: 'image/png8',

tiled: 'true',

transparent: true

},

{

'isBaseLayer': false, 'wrapDateLine': true

}

);

// Now let's try world major rivers

var world_rivers = new OpenLayers.Layer.WMS(

"World Major Rivers",

wmsURL,

{

layers: 'SUA:world_majorrivers',

srs: 'EPSG:4326',

format: 'image/png8',

tiled: 'true',

transparent: true

},

{

'isBaseLayer': false, 'wrapDateLine': true

}

);

// create WMS layer, let's try sua data

//var sua = new OpenLayers.Layer.WMS(

// "SUA sua_location",

// "/geoserver/wms?",

// {

// layers: 'SUA:sua_location',

// styles: '',

// srs: 'EPSG:4326',

// format: 'image/png8',

// tiled: 'true',

// transparent: true

// },

// {

// 'opacity': 0.75, 'isBaseLayer': false, 'wrapDateLine': true

// }

//);

var usBounds = new OpenLayers.Bounds(

-138.955078, 10.942383, -54.84375, 55.942383

);

// add the created layers to the map

//this.map.addLayers([base, us_states, sua]);

this.map.addLayers([base, us_states, us_lakes, world_rivers]);

//this.map.addLayers([base]);

var reqZoom = document.getElementById("reqZoom");

var reqLon = document.getElementById("reqLon");

var reqLat = document.getElementById("reqLat");

var reqLayers = document.getElementById("reqLayers");

if (reqZoom.value != "null" &&

reqLon.value != "null" &&

reqLat.value != "null" &&

reqLayers.value != "null") {

this.map.setCenter(new OpenLayers.LonLat(reqLon.value,reqLat.value),reqZoom.value);

} else {

this.map.zoomToExtent(usBounds,true);

}

// Call updateMap

updateMap();

//*** jbm - disable findLayerClick and Hover for now

this.map.events.register('click',this.map,findLayerClickInteract);

var hover_controls = {

'short': new OpenLayers.Control.Hover({

handlerOptions: {

'delay': 500

}

})

};

var control;

for (var key in hover_controls) {

control = hover_controls[key];

// only to route output here

control.key = key;

this.map.addControl(control);

control.activate();

}

// The syntax below can be used to change the styles

// sua.mergeNewParams({styles: 'jimtest'});

//GOVFAASUA.widgets.Map.superclass.initComponent.apply(this,arguments);

}

});

Ext.reg('GOVFAASUA-widgets-map',GOVFAASUA.widgets.Map);

 
  Currently our layers are all comming from the same server.  I recently tried to set up multiple DNS/host names for the same server to see if that would help.  We still had significant blocking.
 
Thanks,
Jim

[email protected] wrote: -----

To: [email protected]
From: Alexandre Dube <[email protected]>
Sent by: [email protected]
Date: 09/30/2010 09:45AM
Subject: Re: [OpenLayers-Users] OpenLayers - Performance Tuning - Firebug shows 10+ seconds in "blocking" time

Hi Jim,

  What kind of layer object are you using ?  WMS ?  TileCache ?  Are the layers coming from the same service (for example, do you have 5 WMS layer objects pointing to 5 layers from the same WMS server) ?  If so, you could group them in a single layer object.  You could also use 'singleTile' mode to have less requests.

  Tell us more (by code sharing, live demo, etc.).

Regards,

Alexandre


On 10-09-30 09:40 AM, [email protected] wrote:

Hi,

 

   The Firebug Net Profile for my website, after a few requests, shows significant time "blocking".  Has anyone else seen this?  What can be done about it?

 

   My sense is that our site is serving up too many tiled images.  Functionally, we are coloring airspaces based upon when they'll become "active".  So, we have 5+ layers with around 50 tiled  images that must be downloaded.  The reason we are creating the various layers is that they are styled using different colors.  Is there a way to have different styles applied to various airspaces all within one layer so that we can drastically limit the number of images we are serving?

 

Thanks,
Jim



_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
  


--
Alexandre Dubé
Mapgears
www.mapgears.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to