Skip to content

Commit

Permalink
conditionally load streets layers
Browse files Browse the repository at this point in the history
  • Loading branch information
zandre-eng committed Jan 22, 2024
1 parent 4c1b9a0 commit a1c4a88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ hqDefine("geospatial/js/geospatial_map", [
};

function initMap() {
mapModel = new models.Map();
mapModel = new models.Map(false, true);
mapModel.initMap(MAP_CONTAINER_ID);

let selectedCases = ko.computed(function () {
Expand Down
9 changes: 6 additions & 3 deletions corehq/apps/geospatial/static/geospatial/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ hqDefine('geospatial/js/models', [
};
};

var Map = function (usesClusters) {
var Map = function (usesClusters, usesStreetsLayers) {
var self = this;

self.usesClusters = usesClusters;
self.usesStreetsLayers = usesStreetsLayers;

self.mapInstance;
self.drawControls;
Expand Down Expand Up @@ -133,8 +134,10 @@ hqDefine('geospatial/js/models', [
createClusterLayers();
}

loadMapBoxStreetsLayers();
addLayersToPanel();
if (self.usesStreetsLayers) {
loadMapBoxStreetsLayers();
addLayersToPanel();
}
};

function loadMapBoxStreetsLayers() {
Expand Down

0 comments on commit a1c4a88

Please sign in to comment.