calculates the distance between two towns

User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: calculates the distance between two towns

Post 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

   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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: calculates the distance between two towns

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: calculates the distance between two towns

Post 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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: calculates the distance between two towns

Post 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

oMap:bUrl := {|x,y,z| MapControlGooogleMaps(x,y,z)}
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: calculates the distance between two towns

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply