diff --git a/arches/app/media/css/arches.css b/arches/app/media/css/arches.css index 51b5c57e984..0ad06069a4b 100644 --- a/arches/app/media/css/arches.css +++ b/arches/app/media/css/arches.css @@ -1199,6 +1199,7 @@ ul.tabbed-report-tab-list { background: white; border-left: 1px solid rgb(216, 216, 216); padding: 16px; + overflow-y: scroll; } .map-card-sidepanel-header { diff --git a/arches/app/media/js/views/components/cards/map.js b/arches/app/media/js/views/components/cards/map.js index 1b954a8f293..4ab3710cb3e 100644 --- a/arches/app/media/js/views/components/cards/map.js +++ b/arches/app/media/js/views/components/cards/map.js @@ -2,12 +2,11 @@ define([ 'knockout', 'viewmodels/card-component', 'views/components/map' -], function(ko, CardComponentViewModel) { +], function(ko, CardComponentViewModel, MapComponentViewModel) { return ko.components.register('map-card', { viewModel: function(params) { - this.map = ko.observable(); - CardComponentViewModel.apply(this, [params]); + MapComponentViewModel.apply(this, [params]); }, template: { require: 'text!templates/views/components/cards/map.htm' diff --git a/arches/app/media/js/views/components/map.js b/arches/app/media/js/views/components/map.js index a602194550a..d2e5ed4f4bc 100644 --- a/arches/app/media/js/views/components/map.js +++ b/arches/app/media/js/views/components/map.js @@ -32,6 +32,7 @@ define([ }, arches.mapSources, params.sources); var mapLayers = params.mapLayers || arches.mapLayers; + this.map = ko.isObservable(params.map) ? params.map : ko.observable(); this.basemaps = []; this.overlays = ko.observableArray(); this.activeBasemap = ko.observable(); @@ -154,8 +155,6 @@ define([ }; this.setupMap = function(map) { - if (ko.isObservable(params.map)) params.map(map); - map.addControl(new mapboxgl.NavigationControl(), 'top-left'); map.addControl(new MapboxGeocoder({ accessToken: mapboxgl.accessToken, @@ -169,6 +168,8 @@ define([ style.layers = layers; map.setStyle(style); }); + + self.map(map); }; }; ko.components.register('arches-map', { diff --git a/arches/app/templates/views/components/cards/map.htm b/arches/app/templates/views/components/cards/map.htm index 53f99a8d8df..89b0eefe599 100644 --- a/arches/app/templates/views/components/cards/map.htm +++ b/arches/app/templates/views/components/cards/map.htm @@ -2,10 +2,5 @@ {% load i18n %} {% block form %} - +{% include 'views/components/map-editor.htm' %} {% endblock form %} diff --git a/arches/app/templates/views/components/map-editor.htm b/arches/app/templates/views/components/map-editor.htm new file mode 100644 index 00000000000..67cdf1d459f --- /dev/null +++ b/arches/app/templates/views/components/map-editor.htm @@ -0,0 +1,10 @@ +{% extends "views/components/map.htm" %} +{% load i18n %} + +{% block tabs %} +{{ block.super }} +{% endblock tabs %} + +{% block sidepanel %} +{{ block.super }} +{% endblock sidepanel %} diff --git a/arches/app/templates/views/components/map.htm b/arches/app/templates/views/components/map.htm index 10f4c5282e2..0e48467880d 100644 --- a/arches/app/templates/views/components/map.htm +++ b/arches/app/templates/views/components/map.htm @@ -2,6 +2,7 @@