Recent

Author Topic: TMapViewer: Draw an ellipse on a map given Longtitude and Latitude  (Read 1175 times)

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 451
  • Programming is FUN only when it works :)
    • Cool Technology
Hello,

I am using KcMapViewer in place of actual TMapviewer, because TMapViewer won't compile or install on Lazarus and throws all kinds of errors. So, I am using KcMapViewer and it is working very well so far. I am trying to place or draw a simple and small ELLIPSE to represent a marker. I was able to do that Only thing is that that DOT or ELLIPSE ONLY sits right in the middle of the map all the time. So, if I move the map, it won't move. In other word, my ELLIPSE or marker is always in the middle of the map. That is fine, but I want to be able to draw few more DOTS or ELLIPSE or MARKER on the map based on LONGITUDE and LATITUDE and not be CENTERED all the time and these dots should follow or sit where their LONGTITUDE and LONGITUDE is on the map even if I move the map.

For instance, if I input -79.999, 40.4, then KcMapViewer should draw a small ELLIPSE at that LONG/LAT location and stay there even if I move the map. I have included KcMapViewer.pas under this post. Any help will be greatly appreciated. Thanks,  :)

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: TMapViewer: Draw an ellipse on a map given Longtitude and Latitude
« Reply #1 on: March 22, 2019, 10:09:33 pm »
You need to manage your markers using LAT and LUT..

 The image while viewing should also have a marker for the upper left corner starting LAT and LONG.

 The image should also have the ending LAT, LONG for the lower right corner..

 you use these scales to indicate where to draw your ,markers, if any markers in a list fall within these boundaries
then you draw them scaling the image with the LAT and LONG..

 To calculate line distance D := Sqrt(Sqr(X)+Sqr(X2)); etc

 Something on those lines..

 
 its that simple..
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018