[Config][Maps] Added Openstreetmap tile server settings to options table
这个提交包含在:
父节点
3e6998460d
当前提交
3fe6a69807
共有 3 个文件被更改,包括 35 次插入 和 15 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
| be upgraded / downgraded to.
|
| be upgraded / downgraded to.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['migration_version'] = 59;
|
$config['migration_version'] = 60;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This migration creates a table called options which will hold global options needed within cloudlog
|
||||||
|
* removing the need for lots of configuration files.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Migration_add_tileserver_to_options extends CI_Migration {
|
||||||
|
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$data = array(
|
||||||
|
array('option_name' => "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 © <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a>", 'autoload' => "yes")
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->db->insert_batch('options', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
// No option to down
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -418,11 +418,9 @@ $(document).on('change', 'input', function(){
|
||||||
var markers = L.layerGroup();
|
var markers = L.layerGroup();
|
||||||
var mymap = L.map('qsomap').setView([51.505, -0.09], 13);
|
var mymap = L.map('qsomap').setView([51.505, -0.09], 13);
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
|
attribution: '<?php echo $this->optionslib->get_option('map_tile_server_copyright');?>',
|
||||||
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
|
|
||||||
'Created by Cloudlog',
|
|
||||||
id: 'mapbox.streets'
|
id: 'mapbox.streets'
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
|
|
@ -1111,10 +1109,9 @@ $(document).on('change', 'input', function(){
|
||||||
|
|
||||||
var mymap = L.map('map').setView([lat,long], 5);
|
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('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a>, ' +
|
attribution: '<?php echo $this->optionslib->get_option('map_tile_server_copyright');?>',
|
||||||
'Generated by <a href="http://www.cloudlog.co.uk/">Cloudlog</a>',
|
|
||||||
id: 'mapbox.streets'
|
id: 'mapbox.streets'
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
|
|
@ -1162,11 +1159,9 @@ $(document).ready(function(){
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var layer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
var layer = L.tileLayer('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
|
attribution: '<?php echo $this->optionslib->get_option('map_tile_server_copyright');?>',
|
||||||
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
|
|
||||||
'Created by Cloudlog',
|
|
||||||
id: 'mapbox.streets'
|
id: 'mapbox.streets'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1519,10 +1514,9 @@ $(document).ready(function(){
|
||||||
var callsign = $("#callsign").text();
|
var callsign = $("#callsign").text();
|
||||||
var mymap = L.map('mapqso').setView([lat,long], 5);
|
var mymap = L.map('mapqso').setView([lat,long], 5);
|
||||||
|
|
||||||
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
|
L.tileLayer('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a>, ' +
|
attribution: '<?php echo $this->optionslib->get_option('map_tile_server_copyright');?>',
|
||||||
'Generated by <a href="http://www.cloudlog.co.uk/">Cloudlog</a>',
|
|
||||||
id: 'mapbox.streets'
|
id: 'mapbox.streets'
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用