Skip to content

Commit a6d2e2c

Browse files
John YuAlex Perfilov
John Yu
authored and
Alex Perfilov
committed
Map nonfed metrics (GSA#780)
* first map commit * all categories added * safety commit * leaflet map deleted from this branch * datasets table style update * csv xls s3 upload change/ need to be checked * 5/2 * responsive fix * zoombox removed * latest * wp_enqueue * submodule issue * submodule issue 2nd try * 3rd try submodule * display none fix * default hide publishers * markers coordinate fixes * marker coordinates * frontend changes * datasets published per month button * 5/11 * leaflet map update.txt added * 5/12 * full history organization type * button hover * 5/14 * working on table * 5/15 * merge * search feature added * showing entries message * scroll bar * 5/12 3 * colspan * search by org type * metrics button reformat * 5/17 * 5/22 * download csv excel line change * full metrics download line change * Clean up layout at top of metrics page * scroll up fixed, commented console.log code deleted * css moved to rei.css
1 parent ea7aa24 commit a6d2e2c

File tree

153 files changed

+68055
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+68055
-479
lines changed

roots-nextdatagov/assets/Json/fed_agency.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@
19761976
"term": "vets-dol-gov",
19771977
"Federal Agency": "Department of Labor",
19781978
"Sub Agency": "Veterans Employment and Training Service",
1979-
"unique id": "vets-dol-gov ",
1979+
"unique id": "vets-dol-gov",
19801980
"is_cfo": "Y"
19811981
}
19821982
},

roots-nextdatagov/assets/LeafletMap2/GovMap.geojson

+2,441
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
/*
3+
* ENVIRONMENTS
4+
* =================
5+
*/
6+
7+
// Define globals exposed by modern browsers.
8+
"browser": true,
9+
10+
// Define globals exposed by jQuery.
11+
"jquery": true,
12+
13+
"globals": {"L": false},
14+
15+
/*
16+
* ENFORCING OPTIONS
17+
* =================
18+
*/
19+
20+
// Force all variable names to use either camelCase style or UPPER_CASE
21+
// with underscores.
22+
"camelcase": true,
23+
24+
// Prohibit use of == and != in favor of === and !==.
25+
"eqeqeq": true,
26+
27+
// Suppress warnings about == null comparisons.
28+
"eqnull": true,
29+
30+
// Enforce tab width of 2 spaces.
31+
"indent": 2,
32+
33+
"smarttabs": true,
34+
35+
// Prohibit use of a variable before it is defined.
36+
"latedef": true,
37+
38+
// Require capitalized names for constructor functions.
39+
"newcap": true,
40+
41+
// Enforce use of single quotation marks for strings.
42+
"quotmark": "single",
43+
44+
// Prohibit trailing whitespace.
45+
"trailing": true,
46+
47+
// Prohibit use of explicitly undeclared variables.
48+
"undef": true,
49+
50+
// Warn when variables are defined but never used.
51+
"unused": true
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2012, Kartena AB
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Leaflet.Pancontrol](http://kartena.github.com/Leaflet.Pancontrol/)
2+
==================
3+
4+
A panning control for [Leaflet][2].
5+
6+
Tested with Chrome, IE 7-9 and Firefox.
7+
8+
Also see [Leaflet.Zoomslider][1]
9+
10+
### Branches
11+
- 0.4 — tracks Leaflet 0.4.x and should be stable.
12+
- master — tracks Leaflet master and can be considered unstable (but please file bugs!).
13+
14+
[1]: https://github.com/kartena/Leaflet.zoomslider
15+
[2]: https://github.com/CloudMade/Leaflet
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
TODO
2+
====
3+
- <del>Styling</del>
4+
- <del>Prevent double-clicking prevent from zooming map</del>
5+
- <del>Make panning offset configurable</del>
6+
- Do something about the hardcoded support for the zoom- and zoomslider controls.
7+
- <del>Make special CSS's for IE.</del>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="stylesheet" href="style.css" />
6+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
7+
<!--[if lte IE 8]>
8+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.6.4/leaflet.ie.css" />
9+
<![endif]-->
10+
11+
<link rel="stylesheet" href="../src/L.Control.Pan.css" />
12+
<!--[if lt IE 9]>
13+
<link rel="stylesheet" href="../src/L.Control.Pan.ie.css"/>
14+
<![endif]-->
15+
16+
</head>
17+
<body>
18+
<div id="map"></div>
19+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
20+
<script src="../src/L.Control.Pan.js" ></script>
21+
<script src="lib/leaflet-tilejson.js"></script>
22+
<script src="script.js"></script>
23+
</body>
24+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
L.TileJSON = (function() {
2+
var semver = "\\s*[v=]*\\s*([0-9]+)" // major
3+
+ "\\.([0-9]+)" // minor
4+
+ "\\.([0-9]+)" // patch
5+
+ "(-[0-9]+-?)?" // build
6+
+ "([a-zA-Z-][a-zA-Z0-9-\.:]*)?"; // tag
7+
var semverRegEx = new RegExp("^\\s*"+semver+"\\s*$");
8+
9+
var parse = function(v) {
10+
return v.match(semverRegEx);
11+
};
12+
13+
function defined(o){
14+
return (typeof o !== "undefined" && o !== null);
15+
}
16+
17+
function validateVersion(tileJSON) {
18+
if (!tileJSON.tilejson) {
19+
throw new Exception('Missing property "tilejson".');
20+
}
21+
22+
v = parse(tileJSON.tilejson);
23+
if (!v || v[1] != 2) {
24+
throw new Exception('This parser supports version 2 '
25+
+ 'of TileJSON. (Provided version: "'
26+
+ tileJSON.tilejson + '"');
27+
}
28+
};
29+
30+
function parseZoom(tileJSON, cfg) {
31+
if (tileJSON.minzoom) {
32+
cfg.minZoom = parseInt(tileJSON.minzoom);
33+
}
34+
35+
if (tileJSON.maxzoom) {
36+
cfg.maxZoom = parseInt(tileJSON.maxzoom);
37+
} else {
38+
cfg.maxZoom = 22;
39+
}
40+
41+
return cfg;
42+
}
43+
44+
function createMapConfig(tileJSON, cfg) {
45+
validateVersion(tileJSON);
46+
47+
if (!defined(cfg)){
48+
cfg = {};
49+
}
50+
51+
parseZoom(tileJSON, cfg);
52+
53+
if (tileJSON.center) {
54+
var center = tileJSON.center;
55+
cfg.center = new L.LatLng(center[1], center[0]);
56+
cfg.zoom = center[2];
57+
}
58+
59+
if (tileJSON.attribution) {
60+
cfg.attributionControl = true;
61+
}
62+
63+
if (tileJSON.projection) {
64+
var t = tileJSON.transform;
65+
cfg.crs =
66+
L.CRS.proj4js(tileJSON.crs,
67+
tileJSON.projection,
68+
new L.Transformation(t[0], t[1], t[2], t[3]));
69+
// FIXME: This might not be true for all projections, actually
70+
cfg.continuousWorld = true;
71+
}
72+
73+
if (tileJSON.scales) {
74+
var s = tileJSON.scales;
75+
cfg.scale = function(zoom) {
76+
return s[zoom];
77+
}
78+
}
79+
80+
return cfg;
81+
};
82+
83+
function createTileLayerConfig(tileJSON, cfg) {
84+
validateVersion(tileJSON);
85+
86+
if (!defined(cfg)){
87+
cfg = {};
88+
}
89+
90+
parseZoom(tileJSON, cfg);
91+
92+
if (tileJSON.attribution) {
93+
cfg.attribution = tileJSON.attribution;
94+
}
95+
96+
if (tileJSON.scheme) {
97+
cfg.scheme = tileJSON.scheme;
98+
}
99+
100+
if (tileJSON.projection) {
101+
// FIXME: This might not be true for all projections, actually
102+
cfg.continuousWorld = true;
103+
}
104+
105+
return cfg;
106+
};
107+
108+
109+
110+
111+
function createTileLayer(tileJSON) {
112+
var tileUrl = tileJSON.tiles[0].replace(/\$({[sxyz]})/g, '$1');
113+
return new L.TileLayer(tileUrl, createTileLayerConfig(tileJSON));
114+
};
115+
116+
function createMap(id, tileJSON, options) {
117+
var mapConfig;
118+
var tileLayerConfig;
119+
120+
if(defined(options)){
121+
mapConfig = options.mapOptions;
122+
tileLayerConfig = options.tileLayerOptions;
123+
} else {
124+
mapConfig = {};
125+
tileLayerConfig = {};
126+
}
127+
128+
var mapConfig = createMapConfig(tileJSON, mapConfig);
129+
mapConfig.layers = [createTileLayer(tileJSON, tileLayerConfig)];
130+
return new L.Map(id, mapConfig);
131+
}
132+
133+
return {
134+
createMapConfig: createMapConfig,
135+
136+
createTileLayerConfig: createTileLayerConfig,
137+
138+
createTileLayer: createTileLayer,
139+
140+
createMap: createMap
141+
}
142+
}());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var osmTileJSON = {
2+
'tilejson': '2.0.0',
3+
'name': 'OpenStreetMap',
4+
'description': 'A free editable map of the whole world.',
5+
'version': '1.0.0',
6+
'attribution': '&copy; OpenStreetMap contributors, CC-BY-SA',
7+
'scheme': 'xyz',
8+
'tiles': [
9+
'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png',
10+
'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png',
11+
'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'
12+
],
13+
'minzoom': 0,
14+
'maxzoom': 18,
15+
'bounds': [ -180, -85, 180, 85 ],
16+
'center': [ 11.9, 57.7, 8 ]
17+
};
18+
19+
var map = L.TileJSON.createMap('map', osmTileJSON, {
20+
mapOptions: { zoomControl: false }
21+
});
22+
23+
L.control.pan().addTo(map);
24+
L.control.zoom().addTo(map);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
html, body {
2+
height: 100%;
3+
padding: 0;
4+
margin: 0;
5+
}
6+
7+
#map {
8+
position: absolute;
9+
width: 100%;
10+
height: 100%;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "leaflet.pancontrol",
3+
"version": "1.0.0",
4+
"description": "Map pan control for Leaflet",
5+
"main": "src/L.Control.Pan.js",
6+
"directories": {
7+
"example": "examples"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git://github.com/kartena/Leaflet.Pancontrol.git"
15+
},
16+
"keywords": [
17+
"leaflet",
18+
"map",
19+
"pan"
20+
],
21+
"author": "Mattias Bengtsson <[email protected]>",
22+
"contributors": [
23+
"Grant Lucas (https://github.com/grantlucas)",
24+
"Patrik Norman (https://github.com/patsy)",
25+
"Per Liedman <[email protected]> (https://github.com/perliedman/)",
26+
"Benjamin (https://github.com/bdparrish)"
27+
],
28+
"license": "BSD-2-Clause",
29+
"bugs": {
30+
"url": "https://github.com/kartena/Leaflet.Pancontrol/issues"
31+
},
32+
"dependencies": {
33+
"leaflet": "~1.0.2"
34+
}
35+
}

0 commit comments

Comments
 (0)