0

New UI control to toggle signposts on/off based on their content.

Pretty substantial javascript refactoring:
 * All javascript is now in funtions.js.  There is no javascript at all
   in index.html
 * Configuration options moved from template.html to config.js
   template.html moved to web_assets/index.html

config.js allows you to specify pattern-label pairs.  Each label will be
added to an on-screen "signposts" control.  Clicking the checkbox by
each label will show/hide any signposts that match the pattern attached
to that label.  config.js has some examples.

TODO:
 * The signposts control needs better styling.
 * The new javascript needs testing in IE.  Seems ok in Chome and FF.

These large changes may be hard to merge if you have non-trivial JS
changes to template.html locally.  Apologies in advance
This commit is contained in:
Andrew Chin
2010-11-11 21:05:24 -05:00
parent d0267d4e78
commit cd88d63ab3
6 changed files with 453 additions and 286 deletions

28
config.js Normal file
View File

@@ -0,0 +1,28 @@
var config = {
path: 'tiles',
fileExt: '{imgformat}',
tileSize: 384,
defaultZoom: 1,
maxZoom: {maxzoom},
cacheMinutes: 0, // Change this to have browsers automatically request new images every x minutes
debug: false
};
// define a list of pattern-label pairs. Each label will appear
// in the 'Signposts' control, allowing your users to quickly enable
// or disable certain labels. See below for some examples:
var signGroups = {
// "Directions": /^#Direction/i,
// "Big Dig": /big\s*dig/i,
// "Warnings": /warning/i,
};
// Please leave the following variables here:
var markerCollection = {}; // holds groups of markers
var map;
var markersInit = false;
var regionsInit = false;