Page 2 of 2

Re: calculates the distance between two towns

PostPosted: Mon Oct 19, 2020 8:52 am
by Silvio.Falconi
Otto wrote:Hello Silvio,
This is what I tried. But I do not see the marker.
I see that the array containing the marker is filled. But in my case, the marker is not painted.
Best regards,
Otto



you not see any markers because your lat and long are wrong

Code: Select all  Expand view

   local  dist :=0
   local  lat1:=46.7528                         //Sillian
   local  lon1:=12.4211

   local  lat2:=48.2077                         //Lienz
   local  lon2:=16.3705
   local  unit:="K"
 





Also I tried your coordinates and they were wrong

then I search Sillian,Lienz and Brunic to one website and I had the right coordinates

use this website pls https://www.latlong.net/

Sillian 46.747540 |12.417510 LATI|LONG
LIenz 46.829460 |12.768950 LATI|LONG

then insert these coordinates into add marker method

sample
oMap:addmarker(12.417510,46.747540,bdraw)

bdraw is a codeblock to draw the image

I use different bdraw

Re: calculates the distance between two towns

PostPosted: Mon Oct 19, 2020 9:15 am
by Otto
Thank you, Silvio.
But here the markers do not work.
Why do you have another bDraw block.
Would you be so kind to post yours.
Best regards,
Otto

Re: calculates the distance between two towns

PostPosted: Mon Oct 19, 2020 9:37 am
by AntoninoP
Otto, have you see my post in previous page?

Silvio.Falconi wrote:oMap:addmarker(12.417510,46.747540,bdraw)

Silvio, you keep forgetting the radius parameter

Re: calculates the distance between two towns

PostPosted: Mon Oct 19, 2020 9:45 am
by Silvio.Falconi
yes sorry


Image



// sample for Sillian
local oMarker := FW_ReadImage(oWnd,"marker.png")

DEFINE WINDOW oWnd TITLE "Map Test"
SetWndDefault(oWnd)

oMap := TMapControl():New() // open the class

oMap:SetCenter(12.417510,46.747540,10) / set the center of your coordinates

bDraw := {|hDC,x,y| FW_DrawImage(hDC, oMarker, {y-30,x-10,y,x+10},.t.) } // set the Image to call a Marker

oMap:AddMarker(12.417510,46.747540,30,bdraw) // SIllian


oWnd:oClient := oMap
ACTIVATE WINDOW oWnd



Image


with
then oMap := TMapControl():New()
Code: Select all  Expand view
oMap:bUrl := {|x,y,z| MapControlGooogleMaps(x,y,z)}

Re: calculates the distance between two towns

PostPosted: Mon Oct 19, 2020 2:11 pm
by Otto
Hello Antonino, hello Silvio,

Thank you.

I have found the problem. On my system 667px-Map_marker.svg.png is missing.
Now all is working fine.

Best regards,
Otto