Skip to content

Commit

Permalink
hide airfield names at low zoom (+typo)
Browse files Browse the repository at this point in the history
  • Loading branch information
alkissack committed Oct 4, 2023
1 parent c0f3ec9 commit 974b13b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public_html/layers/UK_Civi_Airports_named.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{ "type": "Feature", "properties": { "id": null, "notes_1": "Prestwick" }, "geometry": { "type": "LineString", "coordinates": [ [ -4.579723750859277, 55.510778720157148 ], [ -4.598424611341413, 55.505616056699324 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Prestwick" }, "geometry": { "type": "LineString", "coordinates": [ [ -4.587515776060166, 55.488578877895627 ], [ -4.575749818006822, 55.503453714435913 ] ] } },
{ "type": "Feature", "properties": { "id": 12, "name_1": "Newcastle", "ident_1": "NCL", "notes_1": "Newcastle" }, "geometry": { "type": "LineString", "coordinates": [ [ -1.706648218787066, 55.033509466861865 ], [ -1.673064590171229, 55.042350356119037 ] ] } },
{ "type": "Feature", "id": 21, "properties": { "id": 13, "name_1": "Teeside", "ident_1": "MME", "notes_1": "Teeside" }, "geometry": { "type": "LineString", "coordinates": [ [ -1.44327776699698, 54.501694906330357 ], [ -1.414758954761722, 54.517166329032648 ] ] } },
{ "type": "Feature", "properties": { "id": 13, "name_1": "Teeside", "ident_1": "MME", "notes_1": "Teeside" }, "geometry": { "type": "LineString", "coordinates": [ [ -1.44327776699698, 54.501694906330357 ], [ -1.414758954761722, 54.517166329032648 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Teeside" }, "geometry": { "type": "LineString", "coordinates": [ [ -1.419590010386274, 54.517754308464077 ], [ -1.420447133158372, 54.50667173410055 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Teeside" }, "geometry": { "type": "LineString", "coordinates": [ [ -1.413901831989624, 54.510109915586263 ], [ -1.432057250707698, 54.510697996598878 ] ] } },
{ "type": "Feature", "properties": { "id": 14, "name_1": "Liverpool", "ident_1": "LPL", "notes_1": "Liverpool" }, "geometry": { "type": "LineString", "coordinates": [ [ -2.866491169939565, 53.332940151192503 ], [ -2.832907541323728, 53.334429122863696 ] ] } },
Expand Down Expand Up @@ -56,7 +56,7 @@
{ "type": "Feature", "properties": { "id": 28, "name_1": "Cardiff", "ident_1": "CWL", "notes_1": "Cardiff" }, "geometry": { "type": "LineString", "coordinates": [ [ -3.357914719296703, 51.401191218996864 ], [ -3.328227103281311, 51.391808219959515 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Cardiff" }, "geometry": { "type": "LineString", "coordinates": [ [ -3.343811153683092, 51.402989812435372 ], [ -3.352304461152062, 51.392148569623771 ] ] } },
{ "type": "Feature", "properties": { "id": 29, "name_1": "Saint Athan", "ident_1": "EGSY", "notes_1": "Saint Athan" }, "geometry": { "type": "LineString", "coordinates": [ [ -3.445613962932722, 51.402843983169959 ], [ -3.420991163297909, 51.407534591456681 ] ] } },
{ "type": "Feature", "properties": { "id": 30, "name_1": "Himberside", "ident_1": "HUY", "notes_1": "Himberside" }, "geometry": { "type": "LineString", "coordinates": [ [ -0.344260380048858, 53.583690716033438 ], [ -0.357000268929807, 53.565381776356425 ] ] } },
{ "type": "Feature", "properties": { "id": 30, "name_1": "Humberside", "ident_1": "HUY", "notes_1": "Humberside" }, "geometry": { "type": "LineString", "coordinates": [ [ -0.344260380048858, 53.583690716033438 ], [ -0.357000268929807, 53.565381776356425 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Humberside" }, "geometry": { "type": "LineString", "coordinates": [ [ -0.353045303425556, 53.575836092105398 ], [ -0.33845043072403, 53.576958270591938 ] ] } },
{ "type": "Feature", "properties": { "id": 31, "name_1": "Dublin", "ident_1": "DUB", "notes_1": "Dublin" }, "geometry": { "type": "LineString", "coordinates": [ [ -6.290271018131773, 53.422431198955373 ], [ -6.251106359731274, 53.420303763703558 ] ] } },
{ "type": "Feature", "properties": { "id": null, "notes_1": "Dublin" }, "geometry": { "type": "LineString", "coordinates": [ [ -6.249601372857975, 53.419970038711448 ], [ -6.26192126540219, 53.436903275671682 ] ] } },
Expand Down
12 changes: 6 additions & 6 deletions public_html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ function initialize_map() {
});
var styles = [style];
return function (feature, resolution) {
if (ShowAirfieldNames) {
if (ShowAirfieldNames && ZoomLvl > 7.5) {
style.getText().setText(feature.get("name_1"));
}else style.getText().setText("");
return styles;
Expand Down Expand Up @@ -836,6 +836,8 @@ function initialize_map() {

if (ShowUKMilLayers) {

// LAYERS for UK Military

var matzafLayer= new ol.layer.Vector({
name: "matzaf",
type: "overlay",
Expand Down Expand Up @@ -866,7 +868,7 @@ function initialize_map() {
});
var styles = [style];
return function (feature, resolution) {
if (ShowAirfieldNames) {
if (ShowAirfieldNames && ZoomLvl > 7.5) {
style.getText().setText(feature.get("name_1"));
}else style.getText().setText("");
return styles;
Expand All @@ -875,8 +877,6 @@ function initialize_map() {

});


// LAYERS for UK Military
var awacLayer = new ol.layer.Vector({
name: "awac",
type: "overlay",
Expand Down Expand Up @@ -1284,7 +1284,7 @@ function initialize_map() {
var akrng = ol.sphere.getDistance(SitePosition, coord1);
return (
akret + " " + akbrn + "\u00B0 " +
format_distance_long(akrng, DisplayUnits, 0)
format_distance_long(akrng, DisplayUnits, 0) //+ " "+ZoomLvl
);
} else {
return akret; // no range or bearing required, just return akret
Expand All @@ -1293,7 +1293,7 @@ function initialize_map() {
};

var mousePosition = new ol.control.MousePosition({
coordinateFormat: llFormat(3), // ol.coordinate.createStringXY(4),
coordinateFormat: llFormat(3),
projection: "EPSG:4326",
target: document.getElementById("mouseposition"),
undefinedHTML: " ",
Expand Down

0 comments on commit 974b13b

Please sign in to comment.