Skip to content

Commit

Permalink
clean up spacing, check code for home qth marker
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhouser committed Dec 23, 2024
1 parent 8444a2c commit acefb10
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 43 deletions.
20 changes: 8 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ <h2>Show the Map or the Log</h2>
element.style.display = 'none';
menuLink.classList.add('active');
}

//_map.invalidateSize()
}

function toggleLog(e) {
Expand All @@ -147,17 +145,15 @@ <h2>Show the Map or the Log</h2>
var mapCanvas = document.getElementById('map-canvas');
toggleElement(mapCanvas, sender);
}
// If a lat/long is specified in the query string, try to use it as the
// QTH/Operating location for the log file.
// This allows for semi-obvious location-range mapping
// ex: qth=22.303940,114.170372 will place a yellow marker at 22.3, 114.1 on the map
var qth = getQueryVariable('qth');
if (qth !== null) {
createQTHMarker(qth, "Home QTH")
//createQTHMarker(40.786, -73.961, "Home QTH")
}


// If a lat/long is specified in the query string, try to use it as the
// QTH/Operating location for the log file.
// This allows for semi-obvious location-range mapping
// ex: qth=22.303940,114.170372 will place a yellow marker at 22.3, 114.1 on the map
var qth = getQueryVariable('qth');
if (qth !== null) {
createQTHMarker(qth, "Home QTH")
}
</script>
</body>
</html>
5 changes: 1 addition & 4 deletions qso-mapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 2020/09/05 Stephen Houser, N1SH
*/

html, body {
html, body {
height: 100%;
width: 100%;
}
Expand All @@ -28,11 +28,9 @@ body {
}

#map-canvas {
/* height: calc ( 100vh - 6rem ); */
display: block;
height: 100%;
width: 100%;
/* border: 2px dashed black; */
}

#call-log {
Expand All @@ -52,7 +50,6 @@ body {
width: 100%
}


.qth h1 {
font-size: 2rem;
}
Expand Down
58 changes: 31 additions & 27 deletions qso-mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,38 +218,42 @@ function removeQso(qso) {
* when the marker is selected.
*/
function createQTHMarker(latlong, popupText) {
// To use a smaller marker, use something like this...
var blueMarkerSmall = L.icon({
iconUrl: 'icons/ylw-blank.png',
iconSize: [32, 32], // size of the icon
iconAnchor: [16, 32], // point of the icon which will correspond to marker's location
popupAnchor: [0, -16] // point from which the popup should open relative to the iconAnchor
});
var [latitude, longitude] = latlong.split(',');
var marker = L.marker([latitude, longitude], {icon: blueMarkerSmall, zIndexOffset: 1000});

marker.addTo(_markerFeatureGroup)
.bindPopup(popupText);

_markers.push(marker);
return marker;
// To use a smaller marker, use something like this...
var blueMarkerSmall = L.icon({
iconUrl: 'icons/ylw-blank.png',
iconSize: [32, 32], // size of the icon
iconAnchor: [16, 32], // point of the icon which will correspond to marker's location
popupAnchor: [0, -16] // point from which the popup should open relative to the iconAnchor
});

var [latitude, longitude] = latlong.split(',');
var marker = L.marker([latitude, longitude], {icon: blueMarkerSmall, zIndexOffset: 1000});

marker.addTo(_markerFeatureGroup)
.bindPopup(popupText);

_markers.push(marker);
return marker;
}

/* addMarkerforQth - add a marker to the map for a given operating location */

/* TODO: Does not look like this function is used anywhere, remove in next revision
function addMarkerForQth(qth) {
var latlon = latLonForQso(qth);
if (latlon == null) {
return null;
}

var [latitude, longitude] = latlon;
var popupText = '<div class="qth">' +
'<h1>' + qth.call + '</h1><hr/>' +
'</div>';

marker = createMarker(latitude, longitude, popupText);
return marker;
var latlon = latLonForQso(qth);
if (latlon == null) {
return null;
}
var [latitude, longitude] = latlon;
var popupText = '<div class="qth">' +
'<h1>' + qth.call + '</h1><hr/>' +
'</div>';
marker = createMarker(latitude, longitude, popupText);
return marker;
}
*/

/* addMarkerForQso - add a marker to the map for a given QSO */
function addMarkerForQso(qso) {
Expand Down

0 comments on commit acefb10

Please sign in to comment.