Hi Alexandre,
 
   Here is the second part of the code:
 

// Air Show - Sports Event checkbox

if (document.getElementById("airshow_spevt").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=airshow_spevt");

} else {

myUrl += ("&astype=airshow_spevt");

}

}

// Hazards checkbox

if (document.getElementById("hazards").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=hazards");

} else {

myUrl += ("&astype=hazards");

}

}

// Hi Disaster checkbox

if (document.getElementById("hidis").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=hidis");

} else {

myUrl += ("&astype=hidis");

}

}

// Security checkbox

if (document.getElementById("security").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=security");

} else {

myUrl += ("&astype=security");

}

}

// Search and Rescue checkbox

if (document.getElementById("srch_res").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=srch_res");

} else {

myUrl += ("&astype=srch_res");

}

}

// Special checkbox

if (document.getElementById("special").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=special");

} else {

myUrl += ("&astype=special");

}

}

// Special checkbox

if (document.getElementById("vip").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?astype=vip");

} else {

myUrl += ("&astype=vip");

}

}

//**** Altitude types

// Surface - 10,000 msi checkbox

if (document.getElementById("surf_10").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?alttype=surf_10");

} else {

myUrl += ("&alttype=surf_10");

}

}

// 10,000 msi - 17,000 msi checkbox

if (document.getElementById("10_17").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?alttype=10_17");

} else {

myUrl += ("&alttype=10_17");

}

}

// FL180 - FL280 checkbox

if (document.getElementById("FL180_FL280").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?alttype=FL180_FL280");

} else {

myUrl += ("&alttype=FL180_FL280");

}

}

// FL290 - FL340 checkbox

if (document.getElementById("FL290_FL340").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?alttype=FL290_FL340");

} else {

myUrl += ("&alttype=FL290_FL340");

}

}

// FL350 - FL600 checkbox

if (document.getElementById("FL350_FL600").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?alttype=FL350_FL600");

} else {

myUrl += ("&alttype=FL350_FL600");

}

}

//**** Activation Types

// Not sched checkbox

if (document.getElementById("notsched").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=notsched");

} else {

myUrl += ("&acttype=notsched");

}

}

// 8h-24h checkbox

if (document.getElementById("8h_24h").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=8h_24h");

} else {

myUrl += ("&acttype=8h_24h");

}

}

// 4h-8h checkbox

if (document.getElementById("4h_8h").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=4h_8h");

} else {

myUrl += ("&acttype=4h_8h");

}

}

// 2h-4h checkbox

if (document.getElementById("2h_4h").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=2h_4h");

} else {

myUrl += ("&acttype=2h_4h");

}

}

// 1h-2h checkbox

if (document.getElementById("1h_2h").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=1h_2h");

} else {

myUrl += ("&acttype=1h_2h");

}

}

// < 1 hour checkbox

if (document.getElementById("_1hour").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=_1hour");

} else {

myUrl += ("&acttype=_1hour");

}

}

// Active checkbox

if (document.getElementById("active").checked) {

if (myUrl.indexOf("?") == -1) {

myUrl += ("?acttype=active");

} else {

myUrl += ("&acttype=active");

}

}

var shapeStyle;

var pointsArr = [];

var pointArr = [];

var theArr = [];

var theArrIdx = 0;

// Temporary shapeStore Logic

//var shapeStore = new Ext.data.Store({

// data: [

// [1,"HAYS MOA","redStyle","2009-05-18 12:00","2009-05-19 3:00","-110.000833333333 48.2166666666667,-110.000833333333 47.5,-107.000555555556 47.5,-107.000555555556 48.0833333333333,-109.3675 48.3666666666667,-110.000833333333 48.2166666666667"]

// ],

// reader: new Ext.data.ArrayReader({id:'id'}, [

// 'id',

// 'airspace_name',

// 'thestyle',

// {name: 'start_time', type: 'date', dateFormat: 'Y-m-d G:i'},

// {name: 'end_time', type: 'date', dateFormat: 'Y-m-d G:i'},

// 'gemo'

// ])

// });

timeStore = new Ext.data.Store({

reader: new Ext.data.JsonReader({

root:'thedate'

},['thedate'

])

});

// Define Shapes Datastore

// Airport data store

shapeStore = new Ext.data.Store({

url: myUrl,

reader: new Ext.data.JsonReader({

root:'schedCQL'

},['thecql'

])

});

// New Shape Layer Logic

if (shapes_layer != "") {

// need to remove the layer - it will be readded

for (i = 0; i < shapes_layer.length; i++) {

theMap.removeLayer(shapes_layer[i]);

}

}

var shapeArr = [];

var cqlfilter;

var shapeStyle;

shapeStore.on('load', function(ds){

timeStore.loadData(shapeStore.reader.jsonData);

// Update the Map Time

var theDateSpan = document.getElementById('thedate');

theDateSpan.innerHTML = timeStore.getAt(0).data.thedate + ", " + timeStore.getAt(1).data.thedate;

// Loop through the shapeStore to draw the shapes by Activation Type

for (var i = 0; i < shapeStore.getCount(); i++) {

shapeArr.length = 0;

shapeArr = shapeStore.getAt(i).data.thecql.split("|");

// Build the CQL_FILTER based upon checkbox values

cqlfilter = "";

shapeStyle = "";

cqlfilter = shapeArr[1];

cqlfilter = cqlfilter.replace(/\&gt;/g,'>');

cqlfilter = cqlfilter.replace(/\&lt;/g,'<');

cqlfilter = cqlfilter.replace(/\&#039;/g,"'");

shapeStyle = shapeArr[0];

switch(shapeStyle){

case "active":

shapeStyle = "Active";

break;

case "_1hour":

shapeStyle = "C1hour";

break;

case "1h_2h":

shapeStyle = "C1h2h";

break;

case "2h_4h":

shapeStyle = "C2h4h";

break;

case "4h_8h":

shapeStyle = "C4h8h";

break;

case "8h_24h":

shapeStyle = "C8h24h";

break;

case "notsched":

shapeStyle = "NotScheduled";

break;

}

if (cqlfilter=="") {

cqlfilter="exclude";

}

// IE doesn't have a transparent background with 24bit pngs

if (isIE &&

(version >= 5.5) && (version < 7)) {

var thefmt = "image/png8";

var theop = .7;

} else {

var thefmt = "image/png";

var theop = 1;

}

// Generate the shape layer

var shapelayer = new OpenLayers.Layer.WMS(

"Shapes",

"/geoserver/wms?",

{

layers: 'SUA:schedule',

styles: shapeStyle,

srs: 'EPSG:4326',

format: thefmt,

cql_Filter: cqlfilter,

tiled: 'true',

transparent: true

},

{

'isBaseLayer': false, 'wrapDateLine': true, 'opacity': theop

}

);

theMap.addLayers([shapelayer]);

var shapes_layer = theMap.getLayersByName('Shapes');

}

});

shapeStore.load();

}

I am sending more code in the next email to overcome the list servers file size constraint...
 
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