I've been searching through various inquiries on this particular subject, but none have provided me with a satisfactory response. I have created a map where I've set up 4 axes using the following code:
function axis() {
var bounds = map.getBounds();
var NECorner = bounds.getNorthEast();
var SWCorner = bounds.getSouthWest();
// horizontal top axis
var PolylineCoordinates = [
new google.maps.LatLng(NECorner.lat()-0.0002, NECorner.lng()),
new google.maps.LatLng(NECorner.lat()-0.0002, SWCorner.lng()),
];
var Path = new google.maps.Polyline({
clickable: false,
geodesic: true,
path: PolylineCoordinates,
strokeColor: "#FF0000",
strokeOpacity: 1.000000,
strokeWeight: 0.8
});
Path.setMap(map);
// horizontal low axis
var PolylineCoordinates = [
new google.maps.LatLng(SWCorner.lat()+0.0002, NECorner.lng()),
new google.maps.LatLng(SWCorner.lat()+0.0002, SWCorner.lng()),
];
var Path = new google.maps.Polyline({
clickable: false,
geodesic: true,
path: PolylineCoordinates,
strokeColor: "#FF0000",
strokeOpacity: 1.000000,
strokeWeight: 0.8
});
Path.setMap(map);
// vertical left axis
var PolylineCoordinates...
Now, my objective is to be able to drag these axes horizontally or vertically (depending on the axis) and continuously monitor the position difference between them - both in terms of the horizontals and verticals.
The visual output can be viewed here:https://i.sstatic.net/oadAv.pngIf the question remains unclear, my requirements are as follows:
- ability to move/adjust the four red lines by dragging them with the mouse
- display the value of: abs(latitude_axis1 - latitude-axis2) and abs(longitude_axis1 - longitude-axis2) above the map
If anyone has knowledge or solutions regarding this issue, please assist me. If not, do you know of any similar queries that have been resolved? Thank you.