-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stubs out map card component, re: #4670
- Loading branch information
Showing
4 changed files
with
97 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
define([ | ||
'arches', | ||
'knockout', | ||
'viewmodels/card-component' | ||
], function(arches, ko, CardComponentViewModel) { | ||
return ko.components.register('map-card', { | ||
viewModel: function(params) { | ||
var layers = []; | ||
arches.mapLayers.forEach(function(layer) { | ||
if (layer.addtomap) { | ||
layers = layers.concat(layer.layer_definitions); | ||
} | ||
}); | ||
this.mapStyle = { | ||
"version": 8, | ||
"sources": arches.mapSources, | ||
"sprite": arches.mapboxSprites, | ||
"glyphs": arches.mapboxGlyphs, | ||
"layers": layers | ||
}; | ||
|
||
CardComponentViewModel.apply(this, [params]); | ||
}, | ||
template: { | ||
require: 'text!templates/views/components/cards/map.htm' | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends "views/components/cards/default.htm" %} | ||
{% load i18n %} | ||
|
||
{% block form %} | ||
<div class="map-card-wrapper"> | ||
<div class="map-card-sidebar"> | ||
<div class="map-card-sidebar-tab"> | ||
<i class="fa fa-list-alt"></i> | ||
Legend | ||
</div> | ||
<div class="map-card-sidebar-tab"> | ||
<i class="fa fa-globe"></i> | ||
Basemap | ||
</div> | ||
<div class="map-card-sidebar-tab"> | ||
<i class="fa fa-list"></i> | ||
Overlays | ||
</div> | ||
</div> | ||
<div class="map-card-container" data-bind="mapboxgl: { | ||
mapOptions: { style: mapStyle } | ||
}"> | ||
</div> | ||
</div> | ||
{% endblock form %} |
22 changes: 11 additions & 11 deletions
22
arches/app/templates/views/components/workflows/new-tile-step.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<!-- ko if: tile() && card() --> | ||
<div data-bind="component: { | ||
name: cardComponentLookup[card().model.component_id()].componentname, | ||
params: { | ||
card: card(), | ||
tile: tile(), | ||
provisionalTileViewModel: provisionalTileViewModel, | ||
reviewer: reviewer, | ||
loading: loading, | ||
form: $data | ||
} | ||
}"></div> | ||
<!-- ko component: { | ||
name: cardComponentLookup[card().model.component_id()].componentname, | ||
params: { | ||
card: card(), | ||
tile: tile(), | ||
provisionalTileViewModel: provisionalTileViewModel, | ||
reviewer: reviewer, | ||
loading: loading, | ||
form: $data | ||
} | ||
} --><!-- /ko --> | ||
<!-- /ko --> |