Commit 3fe5ebb9 authored by jonnybradley's avatar jonnybradley

[bp/r70426][FIX] maps: Better positioning of "popover" popups when selected

[bp/r70427][FIX] maps: Add colouring for ferries and airports on nextzen vector maps 
[bp/r70428][FIX] maps: When over a cluster make the tooltips appear correctly for the features revealed within.
parent d5797946
Pipeline #72157550 failed with stages
in 27 minutes and 30 seconds
(function () {
var mapNumber = 0, currentProtocol = document.location.protocol;
if (currentProtocol != 'http:' && currentProtocol != 'https:') {
if (currentProtocol !== 'http:' && currentProtocol !== 'https:') {
currentProtocol = 'https:';
}
......@@ -90,9 +90,15 @@
} else if (kind === "highway"){
color = "#f39";
width = 2;
} else if (kind === "ferry"){
color = "#448cff";
width = 2;
} else if (kind === "aeroway"){
color = "#999";
width = 3;
} else {
color = "#aaa";
console.log("Unknown feature kind: " + kind)
console.log("Unknown road kind: " + kind);
}
style = new ol.style.Style({
stroke: new ol.style.Stroke({
......@@ -797,6 +803,9 @@
if (! feature) {
return;
}
if (layer && layer.getType() === "VECTOR_TILE") {
return;
}
$mapBootstrapDummy.css({
left: pixel[0] + "px",
top: (pixel[1] - 15) + "px"
......@@ -812,8 +821,10 @@
} else if (clusterFeatures.length === 1) {
feature = clusterFeatures[0];
} else if (layer) {
feature = layer.getSource().getClosestFeatureToCoordinate(evt.originalEvent);
// FIXME never seems to find anything
var f = layer.getSource().getSource().getClosestFeatureToCoordinate(evt.coordinate);
if (f) {
feature = f;
}
}
}
if (feature && feature.get("content")) {
......@@ -922,7 +933,9 @@
$mapBootstrapDummy.popover("dispose").popover({
trigger: "manual",
html: true,
content: tr("Loading...")
content: tr("Loading..."),
container: "body",
placement: "auto"
}).popover("show").on('shown.bs.popover', function (event) {
if (type && object) {
$(container).loadInfoboxPopup({
......@@ -936,7 +949,7 @@
$html.find("a.service-dialog").remove();
var title = $html.find("h1").remove().text() || feature.get("content");
$(".popover-header", $popover).text(title);
$(".popover-body", $popover).empty().append($html);
$(".popover-body", $popover).empty().append($html.children());
$popover.mouseleave(function () {
$popover.popover("dispose");
selectionInteraction.getFeatures().clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment