[show-linked-portals] highlight portal and link
This commit is contained in:
parent
badcdbdb18
commit
f6273d5644
@ -22,6 +22,15 @@
|
|||||||
window.plugin.showLinkedPortal = function () {
|
window.plugin.showLinkedPortal = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin.showLinkedPortal.previewOptions = {
|
||||||
|
color: "#C33",
|
||||||
|
opacity: 1,
|
||||||
|
weight: 5,
|
||||||
|
fill: false,
|
||||||
|
dashArray: "1,6",
|
||||||
|
radius: 18,
|
||||||
|
};
|
||||||
|
|
||||||
window.plugin.showLinkedPortal.portalDetail = function (data) {
|
window.plugin.showLinkedPortal.portalDetail = function (data) {
|
||||||
plugin.showLinkedPortal.removePreview();
|
plugin.showLinkedPortal.removePreview();
|
||||||
|
|
||||||
@ -119,14 +128,16 @@ plugin.showLinkedPortal.onLinkedPortalMouseOver = function() {
|
|||||||
|
|
||||||
if(!(lat && lng)) return; // overflow
|
if(!(lat && lng)) return; // overflow
|
||||||
|
|
||||||
var position = L.latLng(lat, lng);
|
var remote = L.latLng(lat, lng);
|
||||||
plugin.showLinkedPortal.preview = L.circleMarker(position, {
|
var local = portals[selectedPortal].getLatLng();
|
||||||
color: "red",
|
|
||||||
weight: 5,
|
plugin.showLinkedPortal.preview = L.layerGroup().addTo(map);
|
||||||
fill: false,
|
|
||||||
dashArray: "1,6",
|
L.circleMarker(remote, plugin.showLinkedPortal.previewOptions)
|
||||||
radius: 18,
|
.addTo(plugin.showLinkedPortal.preview);
|
||||||
}).addTo(map);
|
|
||||||
|
L.geodesicPolyline([local, remote], plugin.showLinkedPortal.previewOptions)
|
||||||
|
.addTo(plugin.showLinkedPortal.preview);
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin.showLinkedPortal.onLinkedPortalMouseOut = function() {
|
plugin.showLinkedPortal.onLinkedPortalMouseOut = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user