From c64beac94aa292f2a0ac24d045b40f6692da6823 Mon Sep 17 00:00:00 2001 From: thyphoonfr Date: Sat, 23 Jul 2016 23:01:02 +0200 Subject: [PATCH] Add Marker you can add Marker --- osm.pb | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/osm.pb b/osm.pb index 555a530..52f924f 100644 --- a/osm.pb +++ b/osm.pb @@ -28,6 +28,7 @@ DeclareModule OSM Declare SetZoom(Zoom.i, mode.i = #PB_Relative) Declare SetCallBackLocation(*CallBackLocation) Declare LoadGpxFile(file.s); + Declare AddMarker(Latitude.d,Longitude.d,color.l=-1) EndDeclareModule Module OSM @@ -74,6 +75,11 @@ Module OSM Semaphore.i EndStructure + Structure Marker + Location.Location + color.l + EndStructure + ;-OSM Structure Structure OSM Gadget.i ; Canvas Gadget Id @@ -110,6 +116,8 @@ Module OSM List track.Location() ;to display a GPX track + List Marker.Marker() ;to diplay marker + EndStructure Global OSM.OSM, Null.i @@ -588,8 +596,8 @@ Module OSM EndIf EndProcedure - Procedure Pointer(x.l,y.l,color.l=#Red) - color=RGBA(255, 0, 0, 255) + Procedure Pointer(x.l,y.l,color=-1) + If color=-1:color=RGBA(255, 0, 0, 255):EndIf VectorSourceColor(color) MovePathCursor(x, y) AddPathLine(-8,-16,#PB_Path_Relative) @@ -602,6 +610,25 @@ Module OSM FillPath(#PB_Path_Preserve):VectorSourceColor(RGBA(0, 0, 0, 255)):StrokePath(1) EndProcedure + Procedure AddMarker(Latitude.d,Longitude.d,color.l=-1) + AddElement(OSM\Marker()) + OSM\Marker()\Location\Latitude=Latitude + OSM\Marker()\Location\Longitude=Longitude + OSM\Marker()\color=color + EndProcedure + + Procedure DrawMarker() + Protected Pixel.Pixel + ForEach OSM\Marker() + If OSM\Marker()\Location\Latitude<>0 And OSM\Marker()\Location\Longitude<>0 + getPixelCoorfromLocation(OSM\Marker()\Location,@Pixel) + If Pixel\X>0 And Pixel\Y>0 And Pixel\X