Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monumental",
"version": "0.2.0",
"version": "0.3.0",
"private": true,
"description": "Monumental app",
"main": "src/index.js",
Expand Down
15 changes: 15 additions & 0 deletions src/components/main/monument/monument.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ <h4 class="monument__subtitle md-headline">Properties</h4>
ng-href="{{$ctrl.getCommonsLink()}}">
<md-icon>collections</md-icon> {{$ctrl.monument.claims.P373.property[$ctrl.lang]}}
</md-button>

<leaflet ng-if="$ctrl.monument.claims.P625"
markers="$ctrl.map.markers"
center="$ctrl.map.center"></leaflet>
<div layout="row" layout-align="center center"
ng-if="$ctrl.monument.claims.P625">
<md-button class="md-primary" flex
ng-href="https://www.google.com/maps?q={{$ctrl.map.markers.marker.lat}},{{$ctrl.map.markers.marker.lng}}">
<md-icon>map</md-icon> Google Maps
</md-button>
<md-button class="md-primary" flex
ng-href="http://www.openstreetmap.org/#map=17/{{$ctrl.map.markers.marker.lat}}/{{$ctrl.map.markers.marker.lng}}">
<md-icon>map</md-icon> OSM
</md-button>
</div>
</div>
</div>
</md-content>
30 changes: 29 additions & 1 deletion src/components/main/monument/monument.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'lodash';

import './monument.scss';
import template from './monument.html';
import '../../../images/marker.png';

const MonumentComponent = {
controller: controller,
Expand All @@ -15,6 +16,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, WikiServic
vm.getCommonsLink = getCommonsLink;
vm.image = [];
vm.lang = $stateParams.lang || 'pl';
vm.map = {};

wikidata.setLanguages([vm.lang, 'en']);
getWikidata();
Expand Down Expand Up @@ -81,9 +83,35 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, WikiServic
if (vm.monument.claims.P131) {
getFullLocation(claims.P131.values[0].value_id);
}
if(vm.monument.interwiki[vm.lang + 'wiki']) {
if (vm.monument.interwiki[vm.lang + 'wiki']) {
getArticleHeader(vm.monument.interwiki[vm.lang + 'wiki'].title);
}
if (vm.monument.claims.P625) {
const value = vm.monument.claims.P625.values[0].value;
const icon = {
iconUrl: 'assets/images/marker.png',
shadowUrl: undefined,
iconSize: [40, 40],
shadowSize: [0, 0],
iconAnchor: [20, 20],
shadowAnchor: [0, 0]
};

vm.map = {
center: {
lat: value.latitude,
lng: value.longitude,
zoom: 15
},
markers: {
marker: {
lat: value.latitude,
lng: value.longitude,
icon: icon
}
}
};
}
getInterwiki();

let title = vm.monument.labels[vm.lang] || vm.monument.labels.en || vm.monument.id;
Expand Down
5 changes: 5 additions & 0 deletions src/components/main/monument/monument.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,9 @@ mo-monument {
}
}

.angular-leaflet-map {
width: 100%;
height: 300px;
margin-top: 20px;
}
}
Binary file added src/images/marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ angular
'restangular',
'infinite-scroll',
'leaflet-directive'
])
])
.config(stateConfig)
.config(themeConfig);
.config(themeConfig)
.config($logProvider => {
$logProvider.debugEnabled(false);
});

/**
* Config of routing
Expand Down Expand Up @@ -68,10 +71,15 @@ function stateConfig($stateProvider, $urlRouterProvider) {
*/
function themeConfig($mdThemingProvider, $provide) {
let tp = $mdThemingProvider;
tp.definePalette('moRed', tp.extendPalette('red', {
'500': '#8f0000',
'600': '#8f0000'
}));

tp.alwaysWatchTheme(true);
tp.theme('default')
.primaryPalette('blue')
.accentPalette('red');
.primaryPalette('moRed')
.accentPalette('blue');

$provide.value('themeProvider', tp);
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ md-content {

a, a.link {
cursor: pointer;
color: rgb(33,150,243);
color: #8f0000;
text-decoration: none;
}

Expand Down