Skip to content

Commit 65a4fb8

Browse files
committed
Merge branch '2024_1_staging' of https://github.com/OpenGIS/Waymark into 2024_1_staging
# Conflicts: # assets/dist/waymark-js/js/waymark-js.min.js # languages/waymark.pot # waymark-js/dist/js/waymark-js.min.js
2 parents c164ce2 + c3e4e87 commit 65a4fb8

File tree

5 files changed

+8
-380
lines changed

5 files changed

+8
-380
lines changed

assets/dist/waymark-js/js/waymark-js.js

Lines changed: 2 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -7896,10 +7896,7 @@ function Waymark_Map() {
78967896
},
78977897
locateOptions: {
78987898
enableHighAccuracy: true,
7899-
}, // ,
7900-
// 'getLocationBounds': function(locationEvent) {
7901-
// return locationEvent.bounds;
7902-
// }
7899+
},
79037900
})
79047901
.addTo(Waymark.map);
79057902

@@ -8874,117 +8871,6 @@ function Waymark_Map() {
88748871
return image_sizes;
88758872
};
88768873

8877-
/*
8878-
public static function build_overlay_content(Array $feature = [], String $feature_type = 'marker', Array $type_data = []) {
8879-
8880-
// Switch by feature_type
8881-
switch ($feature_type) {
8882-
case 'marker':
8883-
$content = '<div class="waymark-overlay-content waymark-overlay-marker" data-marker_latlng="' . $feature['geometry']['coordinates'][1] . ',' . $feature['geometry']['coordinates'][0] . '">' . "\n";
8884-
8885-
break;
8886-
8887-
default:
8888-
$content = '<div class="waymark-overlay-content waymark-overlay-' . $feature_type . '">' . "\n";
8889-
8890-
break;
8891-
}
8892-
8893-
// If we don't have type data
8894-
if (empty($type_data)) {
8895-
// Get Type Data
8896-
$type_data = self::get_type_data($feature_type, $feature['properties']['type_key']);
8897-
8898-
self::debug($type_data);
8899-
8900-
}
8901-
8902-
//Expected Waymark properties
8903-
// i.e. array('radius', 'type', 'title', 'description', 'image_thumbnail_url', 'image_medium_url', 'image_large_url')
8904-
foreach (Waymark_Config::get_item('overlay_properties') as $property_key) {
8905-
//Property not set
8906-
if (!isset($feature['properties'][$property_key])) {
8907-
continue;
8908-
}
8909-
8910-
//Wrap in div
8911-
$content .= '<div class="waymark-overlay-property waymark-overlay-property-' . $property_key . '">';
8912-
8913-
switch ($property_key) {
8914-
8915-
//Title
8916-
case 'title':
8917-
$title = $feature['properties']['title'];
8918-
8919-
//We have a title
8920-
if ($title) {
8921-
$content .= '<strong>' . $feature['properties']['title'] . '</strong>';
8922-
//No description
8923-
} else {
8924-
$content .= '<strong>' . $type_data['type_title'] . '</strong>';
8925-
}
8926-
8927-
break;
8928-
8929-
//Type
8930-
case 'type':
8931-
// if (Waymark_Config::get_item('map_options.show_type_labels') != '1') {
8932-
// break;
8933-
// }
8934-
8935-
$content .= self::type_to_text($feature_type, $type_data, 'small');
8936-
8937-
break;
8938-
8939-
//Description
8940-
case 'description':
8941-
$description = $feature['properties']['description'];
8942-
8943-
//We have a description
8944-
if ($description) {
8945-
//HTML
8946-
if (strpos($description, '<') === 0) {
8947-
$content .= $description;
8948-
//Plain text
8949-
} else {
8950-
$content .= '<p>' . $description . '</p>';
8951-
}
8952-
//No description
8953-
} else {
8954-
$content .= '<p>&nbsp;</p>';
8955-
}
8956-
8957-
break;
8958-
8959-
//Image
8960-
case 'image_large_url':
8961-
//We have an image
8962-
if (isset($feature['properties']['image_large_url'])) {
8963-
//Use Medium if we have it
8964-
$thumb_url = $feature['properties']['image_large_url'];
8965-
if (isset($feature['properties']['image_medium_url'])) {
8966-
$thumb_url = $feature['properties']['image_medium_url'];
8967-
}
8968-
8969-
$content .= '<a href="' . $feature['properties']['image_large_url'] . '" target="_blank" style="background-image:url(' . $thumb_url . ')"></a>';
8970-
//We don't have an image
8971-
} else {
8972-
$content .= '<p>&nbsp;</p>';
8973-
}
8974-
8975-
break;
8976-
8977-
}
8978-
8979-
$content .= '</div>';
8980-
}
8981-
8982-
$content .= '</div>';
8983-
8984-
return $content;
8985-
}
8986-
*/
8987-
89888874
this.build_overlay_content = function (
89898875
feature = [],
89908876
feature_type = "",
@@ -9002,9 +8888,7 @@ public static function build_overlay_content(Array $feature = [], String $featur
90028888
? "waymark-overlay-has-image"
90038889
: "";
90048890

9005-
var content =
9006-
`<div class="waymark-overlay-content ${has_title} ${has_desc} ${has_image} waymark-overlay-${feature_type}">` +
9007-
"\n";
8891+
var content = `<div class="waymark-overlay-content ${has_title} ${has_desc} ${has_image} waymark-overlay-${feature_type}">`;
90088892

90098893
//Expected Waymark properties
90108894
const property_keys = ["type", "title", "description", "image_large_url"];
@@ -9048,15 +8932,11 @@ public static function build_overlay_content(Array $feature = [], String $featur
90488932
} else {
90498933
content += `<p>${description}</p>`;
90508934
}
9051-
//No description
9052-
} else {
9053-
content += "<p>&nbsp;</p>";
90548935
}
90558936

90568937
break;
90578938

90588939
//Image
9059-
90608940
case "image_large_url":
90618941
//We have an image
90628942
if (!feature.properties.image_large_url) {
@@ -9077,10 +8957,6 @@ public static function build_overlay_content(Array $feature = [], String $featur
90778957
}
90788958

90798959
content += `<a href="${feature.properties.image_large_url}" target="_blank" style="background-image:url(${thumb_url})"></a>`;
9080-
9081-
//We don't have an image
9082-
} else {
9083-
content += "<p>&nbsp;</p>";
90848960
}
90858961

90868962
break;

assets/dist/waymark-js/js/waymark-js.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

waymark-js/dist/js/waymark-js.js

Lines changed: 2 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -7896,10 +7896,7 @@ function Waymark_Map() {
78967896
},
78977897
locateOptions: {
78987898
enableHighAccuracy: true,
7899-
}, // ,
7900-
// 'getLocationBounds': function(locationEvent) {
7901-
// return locationEvent.bounds;
7902-
// }
7899+
},
79037900
})
79047901
.addTo(Waymark.map);
79057902

@@ -8874,117 +8871,6 @@ function Waymark_Map() {
88748871
return image_sizes;
88758872
};
88768873

8877-
/*
8878-
public static function build_overlay_content(Array $feature = [], String $feature_type = 'marker', Array $type_data = []) {
8879-
8880-
// Switch by feature_type
8881-
switch ($feature_type) {
8882-
case 'marker':
8883-
$content = '<div class="waymark-overlay-content waymark-overlay-marker" data-marker_latlng="' . $feature['geometry']['coordinates'][1] . ',' . $feature['geometry']['coordinates'][0] . '">' . "\n";
8884-
8885-
break;
8886-
8887-
default:
8888-
$content = '<div class="waymark-overlay-content waymark-overlay-' . $feature_type . '">' . "\n";
8889-
8890-
break;
8891-
}
8892-
8893-
// If we don't have type data
8894-
if (empty($type_data)) {
8895-
// Get Type Data
8896-
$type_data = self::get_type_data($feature_type, $feature['properties']['type_key']);
8897-
8898-
self::debug($type_data);
8899-
8900-
}
8901-
8902-
//Expected Waymark properties
8903-
// i.e. array('radius', 'type', 'title', 'description', 'image_thumbnail_url', 'image_medium_url', 'image_large_url')
8904-
foreach (Waymark_Config::get_item('overlay_properties') as $property_key) {
8905-
//Property not set
8906-
if (!isset($feature['properties'][$property_key])) {
8907-
continue;
8908-
}
8909-
8910-
//Wrap in div
8911-
$content .= '<div class="waymark-overlay-property waymark-overlay-property-' . $property_key . '">';
8912-
8913-
switch ($property_key) {
8914-
8915-
//Title
8916-
case 'title':
8917-
$title = $feature['properties']['title'];
8918-
8919-
//We have a title
8920-
if ($title) {
8921-
$content .= '<strong>' . $feature['properties']['title'] . '</strong>';
8922-
//No description
8923-
} else {
8924-
$content .= '<strong>' . $type_data['type_title'] . '</strong>';
8925-
}
8926-
8927-
break;
8928-
8929-
//Type
8930-
case 'type':
8931-
// if (Waymark_Config::get_item('map_options.show_type_labels') != '1') {
8932-
// break;
8933-
// }
8934-
8935-
$content .= self::type_to_text($feature_type, $type_data, 'small');
8936-
8937-
break;
8938-
8939-
//Description
8940-
case 'description':
8941-
$description = $feature['properties']['description'];
8942-
8943-
//We have a description
8944-
if ($description) {
8945-
//HTML
8946-
if (strpos($description, '<') === 0) {
8947-
$content .= $description;
8948-
//Plain text
8949-
} else {
8950-
$content .= '<p>' . $description . '</p>';
8951-
}
8952-
//No description
8953-
} else {
8954-
$content .= '<p>&nbsp;</p>';
8955-
}
8956-
8957-
break;
8958-
8959-
//Image
8960-
case 'image_large_url':
8961-
//We have an image
8962-
if (isset($feature['properties']['image_large_url'])) {
8963-
//Use Medium if we have it
8964-
$thumb_url = $feature['properties']['image_large_url'];
8965-
if (isset($feature['properties']['image_medium_url'])) {
8966-
$thumb_url = $feature['properties']['image_medium_url'];
8967-
}
8968-
8969-
$content .= '<a href="' . $feature['properties']['image_large_url'] . '" target="_blank" style="background-image:url(' . $thumb_url . ')"></a>';
8970-
//We don't have an image
8971-
} else {
8972-
$content .= '<p>&nbsp;</p>';
8973-
}
8974-
8975-
break;
8976-
8977-
}
8978-
8979-
$content .= '</div>';
8980-
}
8981-
8982-
$content .= '</div>';
8983-
8984-
return $content;
8985-
}
8986-
*/
8987-
89888874
this.build_overlay_content = function (
89898875
feature = [],
89908876
feature_type = "",
@@ -9002,9 +8888,7 @@ public static function build_overlay_content(Array $feature = [], String $featur
90028888
? "waymark-overlay-has-image"
90038889
: "";
90048890

9005-
var content =
9006-
`<div class="waymark-overlay-content ${has_title} ${has_desc} ${has_image} waymark-overlay-${feature_type}">` +
9007-
"\n";
8891+
var content = `<div class="waymark-overlay-content ${has_title} ${has_desc} ${has_image} waymark-overlay-${feature_type}">`;
90088892

90098893
//Expected Waymark properties
90108894
const property_keys = ["type", "title", "description", "image_large_url"];
@@ -9048,15 +8932,11 @@ public static function build_overlay_content(Array $feature = [], String $featur
90488932
} else {
90498933
content += `<p>${description}</p>`;
90508934
}
9051-
//No description
9052-
} else {
9053-
content += "<p>&nbsp;</p>";
90548935
}
90558936

90568937
break;
90578938

90588939
//Image
9059-
90608940
case "image_large_url":
90618941
//We have an image
90628942
if (!feature.properties.image_large_url) {
@@ -9077,10 +8957,6 @@ public static function build_overlay_content(Array $feature = [], String $featur
90778957
}
90788958

90798959
content += `<a href="${feature.properties.image_large_url}" target="_blank" style="background-image:url(${thumb_url})"></a>`;
9080-
9081-
//We don't have an image
9082-
} else {
9083-
content += "<p>&nbsp;</p>";
90848960
}
90858961

90868962
break;

waymark-js/dist/js/waymark-js.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)