From a252b0a80bd0f71f567520e566c4429fb8ecd272 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 14 May 2017 20:55:49 +0000
Subject: [PATCH] Add attributions to the map

---
 map.js     |    7 ++++++-
 lang_en.js |    4 ++++
 lang_pl.js |    4 ++++
 map.css    |    1 +
 4 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/lang_en.js b/lang_en.js
index c49a63f..74f5b55 100644
--- a/lang_en.js
+++ b/lang_en.js
@@ -70,6 +70,10 @@
 	help_source: 'Source',
 	help_license: 'License',
 	
+	copy_osm: 'Map: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
+	copy_zikit: 'Data: <a href="http://www.ttss.krakow.pl/internetservice/">ZIKiT</a>',
+	copy_jacekk: 'Realization: <a href="https://github.com/jacekkow/mpk-ttss">Jacek Kowalski</a>',
+	
 	error_title: 'Error occured!',
 	error_request_failed: 'Internet request failed.',
 	error_request_failed_status: 'Internet request failed with error: $status.',
diff --git a/lang_pl.js b/lang_pl.js
index 5159b44..d124ae5 100644
--- a/lang_pl.js
+++ b/lang_pl.js
@@ -70,6 +70,10 @@
 	help_source: 'Kod źródłowy',
 	help_license: 'Licencja',
 	
+	copy_osm: 'Mapa: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>.',
+	copy_zikit: 'Dane: <a href="http://www.ttss.krakow.pl/internetservice/">ZIKiT</a>.',
+	copy_jacekk: 'Wykonanie: <a href="https://github.com/jacekkow/mpk-ttss">Jacek Kowalski</a>.',
+	
 	error_title: 'Wystąpił błąd!',
 	error_request_failed: 'Wykonanie żądania internetowego nie udało się.',
 	error_request_failed_status: 'Wykonanie żądania internetowego nie udało się. Błąd: $status.',
diff --git a/map.css b/map.css
index 56ca077..29aad28 100644
--- a/map.css
+++ b/map.css
@@ -15,6 +15,7 @@
 #map .ol-attribution {
 	left: 0;
 	right: auto;
+	text-align: left;
 }
 
 #popup {
diff --git a/map.js b/map.js
index b462d46..0cbdf09 100644
--- a/map.js
+++ b/map.js
@@ -616,6 +616,7 @@
 	});
 	stops_layer = new ol.layer.Vector({
 		source: stops_source,
+		
 	});
 	
 	stop_points_source = new ol.source.Vector({
@@ -628,6 +629,7 @@
 	
 	vehicles_source = new ol.source.Vector({
 		features: [],
+		attributions: lang.copy_zikit,
 	});
 	vehicles_layer = new ol.layer.Vector({
 		source: vehicles_source,
@@ -635,6 +637,7 @@
 	
 	route_source = new ol.source.Vector({
 		features: [],
+		attributions: lang.copy_jacekk,
 	});
 	route_layer = new ol.layer.Vector({
 		source: route_source,
@@ -647,7 +650,9 @@
 		target: 'map',
 		layers: [
 			new ol.layer.Tile({
-				source: new ol.source.OSM()
+				source: new ol.source.OSM({
+					attributions: lang.copy_osm,
+				})
 			}),
 			route_layer,
 			stops_layer,

--
Gitblit v1.9.1