I have a basic leaflet map in which I draw a circle representing a city. Next, I would like to locate a rectangle with reference to that circle. (more specifically drawing a rectangle not with reference to its centroid or any corner x,y; but with reference to the circles x,y. So, I need to define the distance with these two objects, and dimensions of rectangle.)

Please see the image below as a graphical expression of this issue:

enter image description here

closed as off-topic by PolyGeo May 23 '18 at 9:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    And your question is? I find your description hard to understand, and I do not understand what you are trying to do, and what the issue is – atlefren Feb 6 '17 at 19:08
  • My question was how to draw the rectangle according to circle's location? – Gamze Feb 8 '17 at 10:07
  • "draw the rectangle according to circle's location" is imprecise – atlefren Feb 8 '17 at 11:09
var position = new L.Rectangle(new L.Circle([x, y], R).getBounds().addTo(map);

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.