diff --git a/Gemfile.lock b/Gemfile.lock
index 2bf38bc8..32e314e5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -134,7 +134,7 @@ GEM
minitest (5.10.1)
multi_json (1.12.1)
nio4r (1.2.1)
- nokogiri (1.7.0.1)
+ nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
parser (2.3.3.1)
ast (~> 2.2)
@@ -205,7 +205,7 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
- rubyzip (1.2.0)
+ rubyzip (1.2.1)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
@@ -303,4 +303,4 @@ DEPENDENCIES
web-console
BUNDLED WITH
- 1.13.6
+ 1.14.6
diff --git a/app/assets/images/help/additional-details-multiple.png b/app/assets/images/help/additional-details-multiple.png
new file mode 100644
index 00000000..0253dfc8
Binary files /dev/null and b/app/assets/images/help/additional-details-multiple.png differ
diff --git a/app/assets/images/help/base-map-toggle.png b/app/assets/images/help/base-map-toggle.png
new file mode 100644
index 00000000..defc86d6
Binary files /dev/null and b/app/assets/images/help/base-map-toggle.png differ
diff --git a/app/assets/images/help/brac-details.png b/app/assets/images/help/brac-details.png
new file mode 100644
index 00000000..075154c3
Binary files /dev/null and b/app/assets/images/help/brac-details.png differ
diff --git a/app/assets/images/help/clear-search.png b/app/assets/images/help/clear-search.png
new file mode 100644
index 00000000..22aa4802
Binary files /dev/null and b/app/assets/images/help/clear-search.png differ
diff --git a/app/assets/images/help/error-message.png b/app/assets/images/help/error-message.png
new file mode 100644
index 00000000..a163efd6
Binary files /dev/null and b/app/assets/images/help/error-message.png differ
diff --git a/app/assets/images/help/geolocation.png b/app/assets/images/help/geolocation.png
new file mode 100644
index 00000000..0128975d
Binary files /dev/null and b/app/assets/images/help/geolocation.png differ
diff --git a/app/assets/images/help/legend.png b/app/assets/images/help/legend.png
new file mode 100644
index 00000000..9d90e0a8
Binary files /dev/null and b/app/assets/images/help/legend.png differ
diff --git a/app/assets/images/help/pegman.png b/app/assets/images/help/pegman.png
new file mode 100644
index 00000000..5fc2a4b7
Binary files /dev/null and b/app/assets/images/help/pegman.png differ
diff --git a/app/assets/images/help/printable-version.png b/app/assets/images/help/printable-version.png
new file mode 100644
index 00000000..3463edd2
Binary files /dev/null and b/app/assets/images/help/printable-version.png differ
diff --git a/app/assets/images/help/qualified-with-expiration.png b/app/assets/images/help/qualified-with-expiration.png
new file mode 100644
index 00000000..15b0c00e
Binary files /dev/null and b/app/assets/images/help/qualified-with-expiration.png differ
diff --git a/app/assets/images/help/search-bar.png b/app/assets/images/help/search-bar.png
new file mode 100644
index 00000000..cf8802db
Binary files /dev/null and b/app/assets/images/help/search-bar.png differ
diff --git a/app/assets/images/help/search-icon.png b/app/assets/images/help/search-icon.png
new file mode 100644
index 00000000..f9bc4dc1
Binary files /dev/null and b/app/assets/images/help/search-icon.png differ
diff --git a/app/assets/images/help/search-query.png b/app/assets/images/help/search-query.png
new file mode 100644
index 00000000..ac8514d5
Binary files /dev/null and b/app/assets/images/help/search-query.png differ
diff --git a/app/assets/images/help/search-results.png b/app/assets/images/help/search-results.png
new file mode 100644
index 00000000..2258423d
Binary files /dev/null and b/app/assets/images/help/search-results.png differ
diff --git a/app/assets/images/help/zoom-control.png b/app/assets/images/help/zoom-control.png
new file mode 100644
index 00000000..2967f04b
Binary files /dev/null and b/app/assets/images/help/zoom-control.png differ
diff --git a/app/assets/javascripts/hzmap/hz-query.js b/app/assets/javascripts/hzmap/hz-query.js
index c1f78769..b6e6cd65 100644
--- a/app/assets/javascripts/hzmap/hz-query.js
+++ b/app/assets/javascripts/hzmap/hz-query.js
@@ -24,31 +24,31 @@ HZApp.HZQuery = {
},
handleBadResponses: function(responseStatus){
if (responseStatus === 'ZERO_RESULTS' || responseStatus === 'INVALID_REQUEST'){
- $('.sidebar-card.map-report').hide();
+ $('.sidebar-card.map-actions').hide();
$('#sidebar-content').addClass('zero-results');
$('#legend').addClass('zero-results');
} else {
- $('.sidebar-card.map-report').show();
+ $('.sidebar-card.map-actions').show();
$('#sidebar-content').removeClass('zero-results');
$('#legend').removeClass('zero-results');
}
},
parseResponseGeometry: function(response){
- if (HZApp.HZQuery.response.geometry){
+ if (response.geometry){
HZApp.MapUtils.jumpToLocation({
viewport: response.geometry.viewport,
location: response.geometry.location
});
- this.response.geocodeLocation = response.geometry.location;
-
if (response.place_id){
this.query.q = response.formatted_address;
this.query.latlng = null;
} else {
this.query.q = null;
- this.query.latlng = [response.geocodeLocation.lat, response.geocodeLocation.lng ].join(',');
+ this.query.latlng = [response.geometry.location.lat, response.geometry.location.lng ].join(',');
}
+
+ this.response.geocodeLocation = response.geometry.location;
}
},
updateMap: function(){
diff --git a/app/assets/javascripts/hzmap/layer-defs.js b/app/assets/javascripts/hzmap/layer-defs.js
index c853e62b..2a51af8f 100644
--- a/app/assets/javascripts/hzmap/layer-defs.js
+++ b/app/assets/javascripts/hzmap/layer-defs.js
@@ -37,6 +37,12 @@ HZApp.Layers.LayerDefs = (function(){
layerGroup: 'qct',
isVisible: true,
overlay:[],
+ },
+ qda_lg: {
+ layerIndex: 5,
+ layerGroup: 'qda',
+ isVisible: true,
+ overlay:[],
}
}
};
diff --git a/app/assets/javascripts/hzmap/legend-defs.js b/app/assets/javascripts/hzmap/legend-defs.js
index d8fb4a70..cd5e28ae 100644
--- a/app/assets/javascripts/hzmap/legend-defs.js
+++ b/app/assets/javascripts/hzmap/legend-defs.js
@@ -4,131 +4,39 @@
// order in this object defines draw order on the map:
// first object is drawn first, then next on top of that, etc.
HZApp.Legend.LegendDefs = (function(){
- var legendDefaults = {
- circleFillColor: '#FFFFFF',
- circleFillOpacity: 0.5,
- circleStrokeColor: '#CCCCCC',
- circleStrokeOpacity: 1,
- circleStrokeWidth: 1,
- displacementX: 0,
- displacementY: 0,
- fillColor: '#CCCCCC',
- fillOpacity: 0.5,
- graphicSpacing: 10,
- lineStrokeColor: '#fff',
- lineStrokeOpacity: 1,
- lineStrokeWidth: 1,
- lineRotation: 0,
- strokeColor: '#CCCCCC',
- strokeOpacity: 1,
- strokeWidth: 1.25,
- tileSize: 10,
-
- // // USWDS Alt 1
- // qctColor: '#2E8540',
- // qnmcColor: '#0071BB',
- // indianLandsColor: '#4C2C92'
-
- // Tyler 1
- qctColor: '#0D465C',
- qnmcColor: '#BA233F',
- indianLandsColor: '#009DCD'
- };
-
var legendKeys = {
qct: {
title: "Census Tract",
svg: [],
canToggle: true,
- layerGroup: 'qct',
- styleOptions: [
- {
- type: 'polygon',
- fillColor: legendDefaults.qctColor,
- fillOpacity: legendDefaults.fillOpacity,
- strokeColor: legendDefaults.qctColor,
- strokeOpacity: legendDefaults.strokeOpacity,
- strokeWidth: legendDefaults.strokeWidth
- }
- ]
+ layerGroup: 'qct'
},
qnmc: {
title: "County",
svg: [],
canToggle: true,
- layerGroup: 'qnmc',
- styleOptions: [
- {
- type: 'polygon',
- fillColor: legendDefaults.qnmcColor,
- fillOpacity: legendDefaults.fillOpacity,
- strokeColor: legendDefaults.qnmcColors,
- strokeOpacity: legendDefaults.strokeOpacity,
- strokeWidth: legendDefaults.strokeWidth
- }
- ]
+ layerGroup: 'qnmc'
},
indian_lands: {
title: "Indian Land",
svg: [],
canToggle: true,
- layerGroup: 'indian_lands',
- styleOptions: [
- {
- type: 'polygon',
- fillColor: legendDefaults.indianLandsColor,
- fillOpacity: legendDefaults.fillOpacity,
- strokeColor: legendDefaults.indianLandsColor,
- strokeOpacity: legendDefaults.strokeOpacity,
- strokeWidth: legendDefaults.strokeWidth
- }
- ]
+ layerGroup: 'indian_lands'
},
redesignated: {
title: "Redesignated",
svg: [],
canToggle: true,
- layerGroup: 'redesignated',
- styleOptions: [
- {
- type: 'horline',
- lineStrokeColor: legendDefaults.lineStrokeColor,
- lineStrokeWidth: 5,
- lineStrokeOpacity: legendDefaults.fillOpacity,
- strokeWidth: legendDefaults.strokeWidth,
- strokeColor: legendDefaults.lineStrokeColor,
- strokeOpacity: legendDefaults.strokeOpacity,
- tileSize: 30,
- lineRotation: 0
- }
- ]
+ layerGroup: 'redesignated'
},
brac: {
title: "Base Closure Area",
svg: [],
canToggle: true,
- layerGroup: 'brac',
- styleOptions: [
- {
- type: 'circle',
- circleFillColor: '#fff',
- circleFillOpacity: legendDefaults.fillOpacity,
- circleStrokeColor: '#fff',
- circleStrokeOpacity: legendDefaults.strokeOpacity,
- circleStrokeWidth: legendDefaults.strokeWidth,
- strokeColor: '#000000',
- strokeOpacity: legendDefaults.strokeOpacity,
- strokeWidth: legendDefaults.strokeWidth,
- tileSize: 15,
- graphicSpacing: legendDefaults.graphicSpacing
- }
- ]
+ layerGroup: 'brac'
},
};
-
return {
- legendDefaults: legendDefaults,
legend: legendKeys
};
-
})();
diff --git a/app/assets/javascripts/hzmap/legend.js.erb b/app/assets/javascripts/hzmap/legend.js.erb
index 49ca049f..4941c317 100644
--- a/app/assets/javascripts/hzmap/legend.js.erb
+++ b/app/assets/javascripts/hzmap/legend.js.erb
@@ -2,147 +2,38 @@
HZApp.Legend = (function(){
return {
legend: HZApp.Legend.LegendDefs.legend,
- buildLegend: function(layers){
- Object.keys(layers).map(function(layer){
- var legendConfig = HZApp.Legend.getConfigFromLayerStyle(layers[layer]);
- HZApp.Legend.legend[legendConfig.layerGroup].svg.push(HZApp.Legend.svgFromStyle(legendConfig));
- });
-
- Object.keys(this.legend).map(HZApp.Legend.insertLegendItem);
-
+ buildLegend: function(){
this.addLegendButtonListeners();
-
- this.setLegendState(window.innerWidth);
-
+ this.setMobileState(window.innerWidth);
this.addLayerToggleListeners();
-
},
addLegendButtonListeners: function(){
- $('#legend-header').click(function(event) {
+ $('.legend-header').click(function(event) {
HZApp.Legend.toggleLegendVisibility(event.currentTarget.className);
});
},
toggleLegendVisibility: function(legendState) {
- if(legendState === 'open') {
+ if(legendState.includes('open')) {
HZApp.Legend.hideLegend();
- $('#legend-header').removeClass('open');
} else {
HZApp.Legend.showLegend();
- $('#legend-header').addClass('open');
}
},
- getConfigFromLayerStyle: function(layer){
- return {
- layerGroup: layer.layerGroup,
- styleType: layer.styleOptions[0].type,
- styleColor: layer.styleOptions[0][HZApp.Legend.legendTypeToColorType[layer.styleOptions[0].type]]
- };
- },
- svgFromStyle: function(style){
- var width = 34, height = 29;
- var svg = this.svgHeader(width, height);
- svg += '
hubzone legend';
- var svg_fn_name = "svg_" + style.styleType;
- svg += HZApp.Legend[svg_fn_name](style,width, height);
- svg += '';
- return svg;
- },
- svgHeader: function(width, height){
- return ('