calculates the distance between two towns

Re: calculates the distance between two towns

Postby Silvio.Falconi » Mon Oct 19, 2020 8:52 am

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  RUN

   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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: calculates the distance between two towns

Postby Otto » Mon Oct 19, 2020 9:15 am

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6337
Joined: Fri Oct 07, 2005 7:07 pm

Re: calculates the distance between two towns

Postby AntoninoP » Mon Oct 19, 2020 9:37 am

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
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: calculates the distance between two towns

Postby Silvio.Falconi » Mon Oct 19, 2020 9:45 am

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  RUN
oMap:bUrl := {|x,y,z| MapControlGooogleMaps(x,y,z)}
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: calculates the distance between two towns

Postby Otto » Mon Oct 19, 2020 2:11 pm

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6337
Joined: Fri Oct 07, 2005 7:07 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 41 guests