Permalink
Browse files

Added "_none" to layer names, updated xpath queries.

Fixes #132
  • Loading branch information...
David Zwarg
David Zwarg committed Oct 10, 2012
1 parent 8e07017 commit 4f1fa3b7849b57b62774b614f59dcd2440d6ebae
@@ -1437,6 +1437,12 @@ def generate_style(geolevel, qset, nclasses, subject=None, layername=None):
doc = generator.as_quantiles(qset, 'characteristic__number__avg', nclasses, propertyname='number',
userstyletitle=us_title, colorbrewername='Greys', invertgradient=False)
# set the width of the borders to 0.25 by default
strokes = doc._node.xpath('//sld:Stroke', namespaces=doc._nsmap)
for stroke in strokes:
node = stroke.xpath('sld:CssParameter[@name="stroke-width"]', namespaces=doc._nsmap)[0]
node.text = '0.25'
if not subject and nclasses == 1:
# remove any fill if subject is missing
fill = doc._node.xpath('//sld:Fill', namespaces=doc._nsmap)[0]
@@ -1457,10 +1463,10 @@ def generate_style(geolevel, qset, nclasses, subject=None, layername=None):
if layername == 'boundary':
stroke = doc._node.xpath('//sld:Stroke', namespaces=doc._nsmap)[0]
node = stroke.xpath('//sld:CssParameter[@name="stroke-width"]', namespaces=doc._nsmap)[0]
node = stroke.xpath('sld:CssParameter[@name="stroke-width"]', namespaces=doc._nsmap)[0]
node.text = '3'
node = stroke.xpath('//sld:CssParameter[@name="stroke"]', namespaces=doc._nsmap)[0]
node = stroke.xpath('sld:CssParameter[@name="stroke"]', namespaces=doc._nsmap)[0]
node.text = '#2BB673'
strokeopacity = {'name':'stroke-opacity'}
@@ -2665,10 +2665,7 @@ function mapinit(srs,maxExtent) {
var newOpts = getControl.protocol.options;
var show = getShowBy();
var snap = getSnapLayer();
var layername = NAMESPACE + ':demo_' + snap.level;
if (show != 'none') {
layername += '_' + show;
}
var layername = NAMESPACE + ':demo_' + snap.level + '_' + show;
var layers = olmap.getLayersByName(layername);
newOpts.featureType = snap.layer;
@@ -2704,10 +2701,7 @@ function mapinit(srs,maxExtent) {
$('#showby').change(function(evt){
var snap = getSnapLayer();
var show = evt.target.value;
var layername = NAMESPACE + ':demo_' + snap.name;
if (show != 'none') {
layername += '_' + show;
}
var layername = NAMESPACE + ':demo_' + snap.name + '_' + show;
var layers = olmap.getLayersByName(layername);
setThematicLayer(layers[0]);
@@ -169,16 +169,14 @@
isdisplayed: {{ demo.isdisplayed }} }{% if not forloop.last %},{% endif %} {% endfor %} ];
var MAP_LAYERS = [];
for (var i = 0; i < SNAP_LAYERS.length; i++) {
MAP_LAYERS.push( NAMESPACE + ':demo_' + SNAP_LAYERS[i].level );
MAP_LAYERS.push( NAMESPACE + ':demo_' + SNAP_LAYERS[i].level + '_none' );
for (var j = 0; j < DEMOGRAPHICS.length; j++) {
MAP_LAYERS.push( NAMESPACE + ':demo_' + SNAP_LAYERS[i].level + '_' + DEMOGRAPHICS[j].value );
}
}
// The maximum number of districts that can exist in this plan.
var MAX_DISTRICTS = parseInt('{{ max_dists }}'.replace(',','').replace('.','').replace(' ',''), 10);
// The name of a 'district' in this plan, could be "District ", etc
/* TODO: These variables may be able to be removed with full i18n support. */
var BODY_MEMBER_SHORT = '{{ body_member_short_label }}';
var BODY_MEMBER_LONG = '{{ body_member_long_label }}';
var BODY_MEMBERS = '{{ body_members }}';
var LEGISLATIVE_BODY = '{{ plan.legislative_body.name|lower }}';
View
@@ -0,0 +1 @@
*sld

0 comments on commit 4f1fa3b

Please sign in to comment.