Leaflet dm and semicricle Unicorn Meta Zoo #1: Why another podcast? ...
How to keep bees out of canned beverages?
How do I check if a string is entirely made of the same substring?
What is the best way to deal with NPC-NPC combat?
How to translate "red flag" into Spanish?
c++ diamond problem - How to call base method only once
My admission is revoked after accepting the admission offer
Did the Roman Empire have penal colonies?
Suing a Police Officer Instead of the Police Department
Multiple fireplaces in an apartment building?
The art of proof summarizing. Are there known rules, or is it a purely common sense matter?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
What is a 'Key' in computer science?
Is a 5 watt UHF/VHF handheld considered QRP?
Is there any hidden 'W' sound after 'comment' in : Comment est-elle?
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
Can you stand up from being prone using Skirmisher outside of your turn?
Check if a string is entirely made of the same substring
Seek and ye shall find
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
What's the difference between using dependency injection with a container and using a service locator?
Has a Nobel Peace laureate ever been accused of war crimes?
What is the ongoing value of the Kanban board to the developers as opposed to management
Is Electric Central Heating worth it if using Solar Panels?
Error: Syntax error. Missing ')' for CASE Statement
Leaflet dm and semicricle
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraBootstrap and Leaflet - Grid IssueOpenlayers Leaflet and popupReset leaflet routing machine route and controlsLeaflet CRS and PostGisConflict standart leaflet polygon and polilyne vs leaflet-dvf pluginWMS GetFeatureInfo and LeafletLeaflet: Panes and PopupsProjections leaflet and OSMLeaflet layer control and legendLeaflet Marker Cluster and Labels white hallow
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am trying to measure and show angle using semicircle library. It would measure angle between two vertices being drawn with PM Leaflet library.
Measuring angles is good, however, drawn semicircle line and the angle lines are not overlapping. I noticed they are overlapping perfectly near 0,0 coordinates but if I try to apply this action near poles, as you suppose, distortion is great.
My code for capturing angle and creating circle.
function captureMove(evt, p1, p2){
let firstAngle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]) * 180 / Math.PI - 90;
let secondAngle = Math.atan2(evt.latlng.lat - p1[0], evt.latlng.lng - p1[1]) * 180 / Math.PI - 90;
firstAngle < 0? firstAngle +=360:''
secondAngle < 0? secondAngle +=360:''
rightClick? createCircle(p1, secondAngle, firstAngle): createCircle(p1, firstAngle, secondAngle);
}
Creating circle:
function createCircle(p1, ang1, ang2){
let noOfLayers = temLayer.getLayers();
if(noOfLayers.length > 1){
temLayer.removeLayer(noOfLayers[1]);
}
ang1 < ang2?ang1+=360:''
var circle = L.semiCircle(p1, {
radius: 1000,
startAngle: 360 - ang1,
stopAngle: 360 - ang2,
color: 'rgba(255,0,0,0.5)',
});
temLayer.addLayer(circle);
};
What could cause this? I realize it is projection distortion. But how to solve this?
leaflet
add a comment |
I am trying to measure and show angle using semicircle library. It would measure angle between two vertices being drawn with PM Leaflet library.
Measuring angles is good, however, drawn semicircle line and the angle lines are not overlapping. I noticed they are overlapping perfectly near 0,0 coordinates but if I try to apply this action near poles, as you suppose, distortion is great.
My code for capturing angle and creating circle.
function captureMove(evt, p1, p2){
let firstAngle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]) * 180 / Math.PI - 90;
let secondAngle = Math.atan2(evt.latlng.lat - p1[0], evt.latlng.lng - p1[1]) * 180 / Math.PI - 90;
firstAngle < 0? firstAngle +=360:''
secondAngle < 0? secondAngle +=360:''
rightClick? createCircle(p1, secondAngle, firstAngle): createCircle(p1, firstAngle, secondAngle);
}
Creating circle:
function createCircle(p1, ang1, ang2){
let noOfLayers = temLayer.getLayers();
if(noOfLayers.length > 1){
temLayer.removeLayer(noOfLayers[1]);
}
ang1 < ang2?ang1+=360:''
var circle = L.semiCircle(p1, {
radius: 1000,
startAngle: 360 - ang1,
stopAngle: 360 - ang2,
color: 'rgba(255,0,0,0.5)',
});
temLayer.addLayer(circle);
};
What could cause this? I realize it is projection distortion. But how to solve this?
leaflet
add a comment |
I am trying to measure and show angle using semicircle library. It would measure angle between two vertices being drawn with PM Leaflet library.
Measuring angles is good, however, drawn semicircle line and the angle lines are not overlapping. I noticed they are overlapping perfectly near 0,0 coordinates but if I try to apply this action near poles, as you suppose, distortion is great.
My code for capturing angle and creating circle.
function captureMove(evt, p1, p2){
let firstAngle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]) * 180 / Math.PI - 90;
let secondAngle = Math.atan2(evt.latlng.lat - p1[0], evt.latlng.lng - p1[1]) * 180 / Math.PI - 90;
firstAngle < 0? firstAngle +=360:''
secondAngle < 0? secondAngle +=360:''
rightClick? createCircle(p1, secondAngle, firstAngle): createCircle(p1, firstAngle, secondAngle);
}
Creating circle:
function createCircle(p1, ang1, ang2){
let noOfLayers = temLayer.getLayers();
if(noOfLayers.length > 1){
temLayer.removeLayer(noOfLayers[1]);
}
ang1 < ang2?ang1+=360:''
var circle = L.semiCircle(p1, {
radius: 1000,
startAngle: 360 - ang1,
stopAngle: 360 - ang2,
color: 'rgba(255,0,0,0.5)',
});
temLayer.addLayer(circle);
};
What could cause this? I realize it is projection distortion. But how to solve this?
leaflet
I am trying to measure and show angle using semicircle library. It would measure angle between two vertices being drawn with PM Leaflet library.
Measuring angles is good, however, drawn semicircle line and the angle lines are not overlapping. I noticed they are overlapping perfectly near 0,0 coordinates but if I try to apply this action near poles, as you suppose, distortion is great.
My code for capturing angle and creating circle.
function captureMove(evt, p1, p2){
let firstAngle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]) * 180 / Math.PI - 90;
let secondAngle = Math.atan2(evt.latlng.lat - p1[0], evt.latlng.lng - p1[1]) * 180 / Math.PI - 90;
firstAngle < 0? firstAngle +=360:''
secondAngle < 0? secondAngle +=360:''
rightClick? createCircle(p1, secondAngle, firstAngle): createCircle(p1, firstAngle, secondAngle);
}
Creating circle:
function createCircle(p1, ang1, ang2){
let noOfLayers = temLayer.getLayers();
if(noOfLayers.length > 1){
temLayer.removeLayer(noOfLayers[1]);
}
ang1 < ang2?ang1+=360:''
var circle = L.semiCircle(p1, {
radius: 1000,
startAngle: 360 - ang1,
stopAngle: 360 - ang2,
color: 'rgba(255,0,0,0.5)',
});
temLayer.addLayer(circle);
};
What could cause this? I realize it is projection distortion. But how to solve this?
leaflet
leaflet
asked 5 mins ago
KumbraKumbra
15
15
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320784%2fleaflet-dm-and-semicricle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320784%2fleaflet-dm-and-semicricle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown