diff options
| author | Mark Wells <mark@freeside.biz> | 2016-12-29 19:30:25 -0800 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2016-12-29 19:30:25 -0800 |
| commit | 65ea9da86b63c56dd577bb0688e8ba01b735bedf (patch) | |
| tree | a75ba139298096a63ada5556e83d1861f44c3414 /httemplate/search/elements/gmap.html | |
| parent | fcba1f6878fcfba20e445889ef24856c90ef3f07 (diff) | |
fix coverage map display when there are no services, #73972
Diffstat (limited to 'httemplate/search/elements/gmap.html')
| -rw-r--r-- | httemplate/search/elements/gmap.html | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/httemplate/search/elements/gmap.html b/httemplate/search/elements/gmap.html index b7d135dd6..47db1507d 100644 --- a/httemplate/search/elements/gmap.html +++ b/httemplate/search/elements/gmap.html @@ -99,11 +99,16 @@ function initMap() { // construct bounds around all of the features var bounds = new google.maps.LatLngBounds; map.data.forEach(function(feature) { - var g = feature.getGeometry(); - if (g.getType() == 'Point') { - bounds.extend(g.get()); - } else if (g.getArray) { - g.getArray().forEach(function(point) { bounds.extend(point); }); + var b = feature.getProperty('bounds'); + if (b) { // if it specifies an ROI, include all of it + bounds.union(b); + } else { + var g = feature.getGeometry(); + if (g.getType() == 'Point') { + bounds.extend(g.get()); + } else if (g.getArray) { + g.getArray().forEach(function(point) { bounds.extend(point); }); + } } }); |
