This commit is contained in:
Keith Paterson 2021-01-07 21:42:12 +01:00
parent 1bba5e2157
commit 2d94425de5
3 changed files with 8 additions and 5 deletions

View File

@ -50,6 +50,9 @@
load (icao) { load (icao) {
this.$parent.mapObject.createPane('threshold-pane') this.$parent.mapObject.createPane('threshold-pane')
this.$parent.mapObject.getPane('threshold-pane').style.zIndex = 550 this.$parent.mapObject.getPane('threshold-pane').style.zIndex = 550
if (this.layerGroup) {
this.layerGroup.removeFrom(this.$parent.mapObject)
}
// Callback for add // Callback for add
this.layerGroup = readThresholdXML(this.$store.state.Settings.settings.airportsDirectory, icao, this.read) this.layerGroup = readThresholdXML(this.$store.state.Settings.settings.airportsDirectory, icao, this.read)
if (!this.layerGroup) { if (!this.layerGroup) {

View File

@ -37,7 +37,7 @@ L.Threshold = L.Marker.extend({
console.debug(`Lat Lng Threshold ${this.getLatLng()}`); console.debug(`Lat Lng Threshold ${this.getLatLng()}`);
if(map !== null) { if(map !== null) {
var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom()); var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom());
console.debug('Old Meters per pixel ' + this.metersPP); console.debug('Old Meters per pixel ' + this._metersPP);
console.debug('New Meters per pixel ' + metersPP); console.debug('New Meters per pixel ' + metersPP);
if(this._metersPP != metersPP) { if(this._metersPP != metersPP) {
var pixelSize = (this.iconSize/2) / metersPP; var pixelSize = (this.iconSize/2) / metersPP;

View File

@ -30,19 +30,19 @@ L.TowerMarker = L.Marker.extend({
return svg2[0]; return svg2[0];
}, },
updateIcon : function(map) { updateIcon : function(map) {
console.debug(`Lat Lng Threshold ${this.getLatLng()}`); console.debug(`Lat Lng Tower ${this.getLatLng()}`);
if(map !== null) { if(map !== null) {
var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom()); var metersPP = this.metersPerPixel(map.getCenter().lat, map.getZoom());
console.debug('Old Meters per pixel ' + this.metersPP); console.debug('Old Meters per pixel ' + this._metersPP);
console.debug('New Meters per pixel ' + metersPP); console.debug('New Meters per pixel ' + metersPP);
if(this._metersPP != metersPP) { if(this._metersPP != metersPP) {
var pixelSize = (this.iconSize/2) / metersPP; var pixelSize = this.iconSize / metersPP;
var scale = pixelSize/this.iconSize; var scale = pixelSize/this.iconSize;
var offset = 0;//-(this.iconSize/2); var offset = 0;//-(this.iconSize/2);
this.setIcon(L.divIcon({ this.setIcon(L.divIcon({
iconSize: 64, iconSize: 64,
className: 'threshold-marker-icon', className: 'threshold-marker-icon',
html: `<div style=\'transform: translateX(${offset}px) translateY(${offset}px) scale(${scale}) rotate(${this.options.heading}deg); border: 1px red\'>${this.svg}</div>`, html: `<div style=\'transform: translateX(${offset}px) translateY(${offset}px) scale(${scale}); border: 1px red\'>${this.svg}</div>`,
})); }));
this.update(this.getLatLng()); this.update(this.getLatLng());