diff --git a/application/config/migration.php b/application/config/migration.php index 40624644..45da3baf 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 59; +$config['migration_version'] = 60; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/060_add_tileserver_to_options.php b/application/migrations/060_add_tileserver_to_options.php new file mode 100644 index 00000000..837160a7 --- /dev/null +++ b/application/migrations/060_add_tileserver_to_options.php @@ -0,0 +1,26 @@ + "map_tile_server", 'option_value' => "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", 'autoload' => "yes"), + array('option_name' => "map_tile_server_copyright", 'option_value' => "Map data © OpenStreetMap", 'autoload' => "yes") + ); + + $this->db->insert_batch('options', $data); + } + + public function down() + { + // No option to down + } +} \ No newline at end of file diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 251db397..ec61fb40 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -418,11 +418,9 @@ $(document).on('change', 'input', function(){ var markers = L.layerGroup(); var mymap = L.map('qsomap').setView([51.505, -0.09], 13); - L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + L.tileLayer('optionslib->get_option('map_tile_server');?>', { maxZoom: 18, - attribution: 'Map data © OpenStreetMap contributors, ' + - 'CC-BY-SA, ' + - 'Created by Cloudlog', + attribution: 'optionslib->get_option('map_tile_server_copyright');?>', id: 'mapbox.streets' }).addTo(mymap); @@ -1111,10 +1109,9 @@ $(document).on('change', 'input', function(){ var mymap = L.map('map').setView([lat,long], 5); - L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { + L.tileLayer('optionslib->get_option('map_tile_server');?>', { maxZoom: 18, - attribution: 'Map data © OpenStreetMap, ' + - 'Generated by Cloudlog', + attribution: 'optionslib->get_option('map_tile_server_copyright');?>', id: 'mapbox.streets' }).addTo(mymap); @@ -1162,11 +1159,9 @@ $(document).ready(function(){