Permalink
Browse files

Made zoom a variable, changed Social/maps to use OpenStreetMap

  • Loading branch information...
=
= committed Nov 26, 2018
1 parent c33865a commit fd6e815b938eb9dd87715d42801368674f43b917
@@ -23,6 +23,7 @@ public function map($day)
function json_map($date) {
$this->load->model('logbook_model');
$this->load->library('qra');
$qsos = $this->logbook_model->map_day($date);
@@ -31,6 +31,7 @@
<?php } ?>
var qso_loc = '<?php echo site_url('dashboard/map');?>';
var q_zoom = 2;
$(document).ready(function(){
initmap();
@@ -23,47 +23,17 @@
<script type="text/javascript" src="<?php echo base_url();?>js/leaflet/leafembed.js"></script>
<script type="text/javascript">
function create_map() {
var latlng = new google.maps.LatLng(40.313043, -32.695312);
var myOptions = {
zoom: 2,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infowindow = new google.maps.InfoWindow();
var marker, i;
/* Get QSO points via json*/
$.getJSON("/logbook/index.php/social/json_map/<?php echo $date; ?>", function(data) {
$.each(data.markers, function(i, val) {
/* Create Markers */
marker = new google.maps.Marker({
position: new google.maps.LatLng(this.lat, this.lng),
map: map
});
/* Store Popup Text */
var content = this.html;
/* Create Popups */
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(content);
infowindow.open(map, marker);
}
})(marker, i));
});
});
var q_lat = 40.313043;
var q_lng = -32.695312;
var q_zoom = 2;
var map = new google.maps.Map(document.getElementById("map"),
myOptions);
}
var qso_loc = '<?php echo site_url("social/json_map/" . $date); ?>';
$(document).ready(function(){
create_map();
$(document).ready(function(){
initmap();
});
</script>
@@ -42,6 +42,7 @@
<?php } ?>
var qso_loc = '<?php echo site_url('dashboard/map');?>';
var q_zoom = 2;
$(document).ready(function(){
initmap();
@@ -19,10 +19,12 @@
margin: 10px 0;
}
</style>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false&key=<?php echo $this->config->item('gmaps_api_key');?>"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.5.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>js/leaflet/leaflet.css" />
<script type="text/javascript" src="<?php echo base_url(); ?>js/leaflet/leaflet.js"></script>
</head>
<body onload="initialize()">
<body>
<?php if ($query->num_rows() > 0) { foreach ($query->result() as $row) {
?>
<h1>QSO with <?php echo $row->COL_CALL; ?> on the <?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); $timestamp = strtotime($row->COL_TIME_ON); echo " at ".date('H:i', $timestamp); ?></h1>
@@ -134,7 +136,7 @@
<div id="stat">
<div id="map_canvas" style="width: 340px; height: 250px"></div>
<div id="map" style="width: 340px; height: 250px"></div>
<?php
if($row->COL_GRIDSQUARE != null) {
@@ -157,23 +159,20 @@
}
?>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(<?php echo $lat; ?>,<?php echo $lng; ?>);
var myOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"<?php echo $row->COL_CALL; ?>"
});
}
</script>
<script type="text/javascript" src="<?php echo base_url();?>js/leaflet/leafembed.js"></script>
<script type="text/javascript">
var q_lat = <?php echo $lat; ?>;
var q_lng = <?php echo $lng; ?>;
var qso_loc = '<?php echo site_url('dashboard/map');?>';
var q_zoom = 6;
$(document).ready(function(){
initmap();
});
</script>
</div>
</div>
@@ -22,7 +22,7 @@ function initmap() {
var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 9, attribution: osmAttrib});
// start the map in South-East England
map.setView(new L.LatLng(q_lat, q_lng), 2);
map.setView(new L.LatLng(q_lat, q_lng), q_zoom);
map.addLayer(osm);
askForPlots();

0 comments on commit fd6e815

Please sign in to comment.