Fixing non-APRS (YSF etc) markers not showing up.

This commit is contained in:
Marat Fayzullin 2023-08-23 13:05:45 -04:00
parent e58f6ac7d5
commit 0522928607
4 changed files with 43 additions and 2 deletions

View File

@ -40,7 +40,10 @@ GMarker.prototype.setMarkerPosition = function(title, lat, lon) {
});
};
//
// GoogleMaps-Specific FeatureMarker
//
function GFeatureMarker() { $.extend(this, new FeatureMarker()); }
GFeatureMarker.prototype = new GMarker();
@ -56,7 +59,10 @@ GFeatureMarker.prototype.place = function() {
}
};
//
// GoogleMaps-Specific AprsMarker
//
function GAprsMarker() { $.extend(this, new AprsMarker()); }
GAprsMarker.prototype = new GMarker();
@ -72,6 +78,29 @@ GAprsMarker.prototype.place = function() {
}
};
//
// GoogleMaps-Specific SimpleMarker
//
function GSimpleMarker() { $.extend(this, new AprsMarker()); }
GSimpleMarker.prototype = new google.maps.Marker();
GSimpleMarker.prototype.setMarkerOpacity = function(opacity) {
this.setOptions({ opacity: opacity });
};
GSimpleMarker.prototype.setMarkerPosition = function(title, lat, lon) {
this.setOptions({
title : title,
position : new google.maps.LatLng(lat, lon)
});
};
GSimpleMarker.prototype.setMarkerOptions = function(options) {
this.setOptions(options);
this.draw();
};
//
// GoogleMaps-Specific Locator
//

View File

@ -6,6 +6,18 @@ function LMarker () {
this._marker = L.marker();
};
LMarker.prototype.onAdd = function() {
this.div = this.create();
var offset = this.getAnchorOffset();
this.setIcon(L.divIcon({
html : this.div,
iconAnchor : [-offset[1], -offset[0]],
className : 'dummy'
}));
};
LMarker.prototype.setMarkerOptions = function(options) {
$.extend(this, options);
if (typeof this.draw !== 'undefined') {

View File

@ -427,7 +427,7 @@ AprsMarker.prototype.draw = function() {
div.style.transform = 'rotate(' + (this.course - 90) + 'deg)';
}
if (this.symbol.table !== '/' && this.symbol.table !== '\\') {
if (this.symbol && this.symbol.table !== '/' && this.symbol.table !== '\\') {
overlay.style.display = 'block';
overlay.style['background-position-x'] = -(this.symbol.tableindex % 16) * 24 + 'px';
overlay.style['background-position-y'] = -Math.floor(this.symbol.tableindex / 16) * 24 + 'px';

View File

@ -159,7 +159,7 @@ MapManager.prototype.processUpdates = function(updates) {
switch (update.location.type) {
case 'latlon':
var marker = self.mman.find(update.callsign);
var markerClass = google.maps.Marker;
var markerClass = GSimpleMarker;
var aprsOptions = {}
if (update.location.symbol) {