Skip to content

Commit

Permalink
#114 new bbox...
Browse files Browse the repository at this point in the history
  • Loading branch information
webgisdeveloper committed Apr 13, 2021
1 parent 70db640 commit bd18699
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions simccs_maptool/static/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,17 @@ function addcostsurface(bbox) {
//load default national cost surface
var cost_image_url="https://simccs.org/geoserver/ows?service=WCS&version=2.0.0&request=GetCoverage&coverageId=SimCCS__cost&format=png";
// &subset=Lat(29.920588,33.381122)&subset=Long(-89.251876,-83.277539)";
//"BBOX": [-89.91, 38.1, -87.7, 40.9]}}
// get bounds from feature group
var allvectorlayers = [];
for (let [key, value] of Object.entries(maplayers)) {
allvectorlayers.push(value); }
var vectorGroup = L.featureGroup(allvectorlayers);
var vectorbounds = vectorGroup.getBounds();
var vecb = vectorGroup.getBounds();
console.log(vectorbounds);
//"BBOX": [-89.91, 38.1, -87.7, 40.9]}}
// BBOX: [west, south, east, north]
bbox = [vecb.getWest(),vecb.getSouth(),vecb.getEast(),vecb.getNorth()];

allvectorlayers = null;
vectorGroup = null;
cost_image_url += "&subset=Lat(" +(bbox[1]-0.2) +","+(bbox[3]+0.2) +")";
Expand Down

0 comments on commit bd18699

Please sign in to comment.