Lazmapviewer: overlaying a semi-transparent area lazarus / 21-General ---------------------------------------------------------------------- MarkMLl · 2024-06-10 08:35 Given a closed area specified by lat/long coordinates, is it possible to overlay this onto LazMapViewer as a semi-transparent image? Context is roughly "be aware that this is controlled airspace and you should be telling somebody you're entering it", so I'd like to be able to wash it in e.g. pink in a way that didn't obscure the underlying map or any tracks drawn over it. Xref to https://forum.lazarus.freepascal.org/index.php/topic,66345.msg 507828.html which discussed drawing tracks. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-06-11 07:26 Does anybody have any thoughts on this please? Do I have to do something baroque like setting up a custom map provider server? MarkMLl ---------------------------------------------------------------------- alpine · 2024-06-11 08:56 Currently the only way to draw with alpha channel is with the DrawingEngine's DrawBitmap method. QuoteDo I have to do something baroque like setting up a custom map provider server?You can take a look at TGPSTileLayerLabels in mvmapviewer.pas - when added it will draw a text label over each tile containing the tile's X,Y,Z. The same way a bitmap can be drawn over. Most of the drawing complications are because the MapView.Cyclic property, but with enough zoom or Cyclic=false it should be much simpler.  PS: I had the idea to implement just that, recently more pressing issues emerged and work on LazMapViewer went on the back burner. Maybe it's time to get back to it after one needs it. ---------------------------------------------------------------------- loaded · 2024-06-11 09:03 I think making Lazmapviewer use BGRABitmap for drawing map tiles will give you the effect you want. ---------------------------------------------------------------------- MarkMLl · 2024-06-11 09:17 Thanks for that, will investigate. The only other way that occurs to me is to draw a track, convert the points to screen coordinates, and draw a filled polygon... provided of course that I can access the canvas, and work out how to refresh when needed. https://forum.lazarus.freepascal.org/index.php?topic=12674.60 appears relevant. Considering the image I posted at https://forum.lazarus.freepascal.org /index.php/topic,65082.msg495499.html#msg495499 (which was actually a screenshot from QGIS), I now have fairly good capabilities for classifying a "point of interest", i.e. distance from field, alignment with circuit and strip, incursion into prohibited areas, observational azimuth/elevation and so on. That leaves the bulk of my problems being graphical: overlays for circuit/strip and prohibited areas, and then addition/removal of live tracks. In practice I have to drop this for a while: I have a couple of tax returns to do and some hardware I've promised to look at. However any thoughts appended here would be welcome. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-06-11 10:47 Quote from: loaded on June 11, 2024, 11:03:42 amI think making Lazmapviewer use BGRABitmap for drawing map tiles will give you the effect you want. Looking (very briefly) at the source, I see the drawing engine interface has a Polygon() function as standard. However I haven't yet investigated fill and opacity... if the example images you posted were done from inside LazMapviewer then it's obviously encouraging (any chance of appending example code?). Anyway, as I've said: I have to drop this for a while do to pressing demands on my time. MarkMLl ---------------------------------------------------------------------- loaded · 2024-06-11 11:29 Quote from: MarkMLl on June 11, 2024, 12:47:03 pmLooking (very briefly) at the source, I see the drawing engine interface has a Polygon() function as standard. However I haven't yet investigated fill and opacity... if the example images you posted were done from inside LazMapviewer then it's obviously encouraging (any chance of appending example code?). Hey MarkMLl Sample images above; It was prepared in the simple CAD application I wrote before. The purpose here is; To see the houses within the parcel when field color fills are on. Actually the same logic. A long time ago, about 5 years ago, I had a project where I was working on Drawing Transparent Polygons to perform area calculations on an immutable Satellite View loaded on a BGRABitmap object, without using Lazmapviewer. That's where the idea for BGRABitmap comes from. If I can find the project when I get home in the evening, I will share it here. During this time, I am not aware of any changes or updates made to Lazmapviewer. I know wp (I would like to take this opportunity to thank him very much. He has a great influence on me) is very talented and knowledgeable on this subject. I hope he also gives his opinion. ---------------------------------------------------------------------- MarkMLl · 2024-06-11 12:00 Quote from: loaded on June 11, 2024, 01:29:42 pm...immutable Satellite View loaded on a BGRABitmap object, without using Lazmapviewer. That's where the idea for BGRABitmap comes from. If I can find the project when I get home in the evening, I will share it here. That's the issue. The questions are (a) from a program which relies heavily on LMV, are the drawing engine functions relevant to semi- opaque arbitrary polygons accessible and (b) since the bulk of the program uses lat/long coordinates can these be converted to canvas x/y coordinates (which are presumably what are used by the drawing engine) in a way that tracks zoom and pan? It might turn out to be expedient to add polygon/opacity support to the drawing engine interface, even if LMV itself doesn't make use of them. MarkMLl ---------------------------------------------------------------------- loaded · 2024-06-11 12:20 Quote from: MarkMLl on June 11, 2024, 02:00:07 pmThe questions are (a) ... (b) The answers to your questions are available in the application I wrote on the Android platform. https://youtu.be/gBS0AMrJ50s?si=rkEJ6t7mQCJBaJ3w If you watch it, you will please me. Surfaceview object is used in the application. https://developer.android.com/reference/android/view/SurfaceView I believe these can be easily done in Lazmapviewer. ---------------------------------------------------------------------- alpine · 2024-06-11 12:58 Quote from: MarkMLl on June 11, 2024, 02:00:07 pmThe questions are (a) from a program which relies heavily on LMV, are the drawing engine functions relevant to semi-opaque arbitrary polygons accessible and While there is a Polygon() engine method, the transparency is not yet supported. That is due to the fact several graphics libraries can be used (BGRA included) and just the lowest common functionality is implemented. Quote from: MarkMLl on June 11, 2024, 02:00:07 pm(b) since the bulk of the program uses lat/long coordinates can these be converted to canvas x/y coordinates (which are presumably what are used by the drawing engine) in a way that tracks zoom and pan? Yes, definitely. ---------------------------------------------------------------------- MarkMLl · 2024-06-11 13:23 Quote from: alpine on June 11, 2024, 02:58:40 pmWhile there is a Polygon() engine method, the transparency is not yet supported. That is due to the fact several graphics libraries can be used (BGRA included) and just the lowest common functionality is implemented. When I'm next on it, I'll be tempted to add transparency etc. even if in some cases it has to have a dummy implementation. What I'm trying to do is basically fuse https://forum.lazarus.freepasc al.org/index.php/topic,65082.msg495499.html#msg495499 and https://www.deanland-airfield.co.uk/templates/g5_anacron/custom/images /misc/OS_shot_circuit_path.png : live data collection I've done and backend storage etc. is no problem. MarkMLl ---------------------------------------------------------------------- loaded · 2024-06-11 19:49 My basic work for drawing interactive transparent polygon on fixed satellite view. The aim here was to understand the logic of drawing interactive transparent polygons. I cleared the Timage object due to size issue. If you want, you can add a satellite view. So it can be understood more clearly. This is a very old work of mine, so I may make mistakes, I hope you will forgive me. Respects. ---------------------------------------------------------------------- alpine · 2024-07-03 09:35 @MarkMLl As of r9377 LazMapViewer is now capable to draw a semi-transparent areas. I'm attaching a sample screenshot and project. ---------------------------------------------------------------------- MarkMLl · 2024-07-03 09:37 Thanks for that, I'll grab an update as soon as I've got some more of the underlying Rx issues sorted... couple of days perhaps. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-07-12 08:37 OK, working with r9380. I can see how that hangs together nicely from the POV of the designer, but am struggling to work out the equivalent runtime code: there are simply too many layers of generics etc. and I find it unclear what can be done in-situ and what has to be done by building objects as local variables and then adding them to the layer. Is there any chance of an example which shows the code-driven creation of a layer containing one of those shaded triangles from some lat/long points, and another with a track of one or two segments again from lat/long points. If I could have something along those lines which I can work into my own code, I'll then write it up in the wiki article to try to save other people similar effort. Xref to related discussion at https://forum.lazarus.freepascal.org/ind ex.php/topic,66345.msg507828.html#msg507828 MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-12 10:08 Quote from: MarkMLl on July 12, 2024, 10:37:59 amIs there any chance of an example which shows the code-driven creation of a layer containing one of those shaded triangles from some lat/long points, and another with a track of one or two segments again from lat/long points. Sure. Just need some time for that, probably in late afternoon... ---------------------------------------------------------------------- MarkMLl · 2024-07-12 10:34 At your own pace, I've got plenty else to do: initialisation files, backend database, radio reliability... MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-12 17:08 OK, I've modified the project from the reply #12 to add programmatically the two areas shown. What is changed: The layer with the two areas defined previously into the form was marked invisibleOn FormCreate one of two procedures can be invoked: AddAreas_mvMapViewer or AddAreas_mvGpsObj The AddAreas_mvMapViewer procedure will create a TMapLayer with two TMapArea. It should be equivalent to what is created previously with the designer. The AddAreas_mvGpsObj procedure will create TGPSComboLayer with two TGPSArea. It uses the mvGpsObj unit, i.e. the "original stuff" which wasn't previously meant for the designer manipulation.  In fact, the TMapXXX classes are (more or less) designer-oriented wrappers for classes in mvGpsObj unit. Analogically, if you want to create tracks instead of areas, you must substitute: in AddAreas_mvMapViewer: TMapArea with TMapTrack (and use Layer.Tracks.Add instead of Layer.Areas.Add)TMapAreaPoint with TMapTrackPoint in AddAreas_mvGpsObj: TGPSArea with TGPSTrackTGPSPoint is used in both, no need to be substituted Hope that helps. ---------------------------------------------------------------------- lar · 2024-07-12 17:25 Not sure if this would help, but several weeks ago I posted a component in topic "LazMapViewer v.0.2.7" that serves as an interface to LazMapViewer. It retrieves a street map image into a bitmap on which a user can then do their own custom drawing (like layers in a GIS) without needing to add the windowed TMapView control to their project. #Alpine provided some help in getting it to work. The component has only two functions, one to set a map provider and another to return a map image centered at a given lon,lat, at a given zoom level, placed in a bitmap of specified width and height. Unlike LazMapViewer, the component user would be responsible for implementing their own zooming and panning operations. I needed this type of interface since my use case involved drawing thousands of line segments and circles representing a city's water and sewer lines over the street map. ---------------------------------------------------------------------- MarkMLl · 2024-07-12 17:48 Quote from: alpine on July 12, 2024, 07:08:42 pmOK, I've modified the project from the reply #12 to add programmatically the two areas shown. Thanks (and noting also Iar's comment), I'm on it and will report back. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-07-13 09:18 OK, I think I see better what's going on now and hopefully this will be a good foundation for when I'm displaying live tracks. I've extended it to display both areas and tracks but do have a slight problem in that I appear to only be able to display one or the other- even if I add a second layer. I need to work on some RF-related stuff now, since there are various kinds of traffic which only show up at weekends. However I'm tacking in an obviously-incomplete code fragment (normally invoked in the context of form creation) below in case anybody can see my glaring mistake :-) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   procedure initMapView;   var    scratchLayer: TMapLayer;      procedure addArea(const area: TRegionDegs; colour: TColor; opacity: single);   var      scratchArea: TMapArea;      i: integer;     begin       (* Add an areas object to the layer which will act as a container for   *)      (* coloured static blocks, returning a reference which may be used        *)      (* locally.                                                             *)       scratchArea := scratchLayer.Areas.Add as TMapArea;       (* Using that reference which is retained in-scope, set up drawing style  *)      (* and add features.                                                    *)       scratchArea.LineColor := clNone;      scratchArea.FillColor := colour;      scratchArea.Opacity := opacity;      for i := 0 to High(area) do        with scratchArea.Points.Add as TMapAreaPoint do begin          Latitude := area[i].Lat;          Longitude := area[i].Lon        end    end { addArea } ;      procedure addAreas(const areas: TRegionsDegs; colour: TColor; opacity: single);     var      i: integer;     begin      for i := 0 to High(areas) do        addArea(areas[i], colour, opacity)    end { addAreas } ;      procedure addTrack(const pLine: TPolylineDegs; colour: TColor; opacity: single);     var      scratchTrack: TMapTrack;      i: integer;     begin       (* Add a tracks object to the layer which will act as a container for     *)      (* coloured static polylines, returning a reference which may be used     *)      (* locally.                                                             *)       scratchTrack := scratchLayer.Tracks.Add as TMapTrack;     (* Using that reference which is retained in-scope, set up drawing style  *)      (* and add features.                                                    *)       scratchTrack.LineWidth := 2;      scratchTrack.LineColor := colour;      scratchTrack.ConnectWidth := scratchTrack.LineWidth;      scratchTrack.ConnectColor := scratchTrack.LineColor;      scratchTrack.Opacity := opacity;      for i := 0 to High(pLine) do        with scratchTrack.Points.Add as TMapTrackPoint do begin          Latitude := pLine[i].Lat;          Longitude := pLine[i].Lon        end    end { addTrack } ;      procedure addTracks(const pLines: TPolylinesDegs; colour: TColor; opacity: single);     var      i: integer;     begin      for i := 0 to High(pLines) do        addTrack(pLines[i], colour, opacity)    end { addTracks } ;    begin   (* Add a layer object to the MapView which will act as a container for areas  *)  (* and tracks, returning a reference which may be used locally.               *)     scratchLayer := MapView1.Layers.Add as TMapLayer;   (* Using that reference which is retained in-scope, add coloured static areas *)  (* to represent properties or villages which should not be overflown at low-  *)  (* levels, and an "in-circuit" area within which aircraft should exercise     *)  (* caution.                                                                 *)     addAreas(Avoids, clRed, 1/6);    addArea(InCircuit, clBlue, 1/16); //    scratchLayer := MapView1.Layers.Add as TMapLayer;    DOESN'T HELP   (* Again using the retained reference, add the circuit and the runway         *)  (* alignment.                                                               *)     addTrack(Circuit, clGreen, 1/4);    addTrack(RunwayDegs, clBlack, 1/4)  end { initMapView } ;  In a day or so's time I'll write a test program with a mapview with "avoid" areas and a circuit diagram, trying to move all map centering etc. into the runtime. It obviously won't have any data-collection facilities etc., but I think it would be a useful demo and focus for discussion. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-13 12:09 QuoteHowever I'm tacking in an obviously-incomplete code fragment (normally invoked in the context of form creation) below in case anybody can see my glaring mistake :-)Assuming: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TRegionDegs = array of TRealPoint;  TRegionsDegs = array of TRegionDegs;  TPolylineDegs = TRegionDegs; //array of TRealPoint;  TPolylinesDegs = TRegionsDegs; //array of TRegionDegs; Your procedure works perfectly well for me. For what mistake you're talking about? ---------------------------------------------------------------------- MarkMLl · 2024-07-13 12:36 Problem at present is that I can see areas, or tracks, but not both. Leave it with me to distill everything into a simpler program... likely Monday unless it rains first. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-13 13:12 Quote from: MarkMLl on July 13, 2024, 02:36:51 pmProblem at present is that I can see areas, or tracks, but not both. Leave it with me to distill everything into a simpler program... likely Monday unless it rains first. MarkMLl You should have described the error earlier Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     (* Using that reference which is retained in-scope, set up drawing style  *)    (* and add features.                                                    *)     scratchArea.LineColor := clNone; // change it to something different Most probably it is my mistake. Seems that clNone affects the next drawings. ---------------------------------------------------------------------- MarkMLl · 2024-07-13 13:24 Damn... should have spotted that one and experimented. Leave it with me, but right now I don't want to interrupt the program run. Having the area displayed has showed up an internal geometry error with without any doubt has been responsible for various classification mistakes, giving me a good order in which to investigate and fix things :-) MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-07-13 19:15 I /did/ describe it earlier; second para in #20 :-) In any event, I can confirm that if the outline is set to clBlack (which in practice is barely visible hence "not unattractive" ** ) the tracks display as well. Things aren't quite lined up yet, the kink in the approach is intentional so that pilots respect the privacy of one of the local magnates :-) MarkMLl ** Roughly translated: "look pretty good" :-) ---------------------------------------------------------------------- alpine · 2024-07-13 19:49 Quote from: MarkMLl on July 13, 2024, 09:15:04 pmI /did/ describe it earlier; second para in #20 :-) Yes, you did. I don't know what to say, maybe it's that we're having such freaking hot weather here that it's slowly melting my brain. Quote from: MarkMLl on July 13, 2024, 09:15:04 pmIn any event, I can confirm that if the outline is set to clBlack (which in practice is barely visible hence "not unattractive" ** ) the tracks display as well. You may try also with LineColor:=FillColor, or/and with a low opacity. Anyway, I fixed it locally, but will commit later as there are some other glosses. ---------------------------------------------------------------------- MarkMLl · 2024-07-13 20:33 Quote from: alpine on July 13, 2024, 09:49:41 pmQuote from: MarkMLl on July 13, 2024, 09:15:04 pmI /did/ describe it earlier; second para in #20 :-) Yes, you did. I don't know what to say, maybe it's that we're having such freaking hot weather here that it's slowly melting my brain. /Hot????/ I'm in the UK, and came indoors a couple of hours ago since it was getting chilly... QuoteYou may try also with LineColor:=FillColor, or/and with a low opacity. Anyway, I fixed it locally, but will commit later as there are some other glosses. Yes, it appears to only be clNone which screws things... even if there is an accessible opacity for the outline having a minimal accent there is quite attractive. Please let us know if you commit changes, but I'll get onto a stripped-down demo program. $DEITY this takes me back: GKS in the 1980s, streamed out as a CGM Metafile... I wrote some of that stuff in the DR era. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-13 22:13 Quote from: MarkMLl on July 13, 2024, 10:33:02 pm/Hot????/ I'm in the UK, and came indoors a couple of hours ago since it was getting chilly... At the present moment I'd trade a beer or two at your place for any whim about LMV. Since the r9377 I'm working on an IDE track points editor. It turns out that the IDE designer mechanics is way beyond my level of comprehension (and broadly undocumented), so everything  is a complete mess at the present. I'll put some effort to isolate it and to make the commit for that fix. ---------------------------------------------------------------------- MarkMLl · 2024-07-13 22:25 Quote from: alpine on July 14, 2024, 12:13:21 amAt the present moment I'd trade a beer or two at your place for any whim about LMV. 10.6C outside. Somebody's 50th birthday party nearby... youngster :-) QuoteSince the r9377 I'm working on an IDE track points editor. It turns out that the IDE designer mechanics is way beyond my level of comprehension (and broadly undocumented), so everything  is a complete mess at the present. I'll put some effort to isolate it and to make the commit for that fix. IDE documentation is a problem. I have absolutely no suggestions, since the project has been running so long that even the current maintainers might no longer understand every possible facet. Which is why I think moving all initialisation into a demo program is worthwhile. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-16 17:01 New commit r9385 for LazMapViewer in lazarus-ccr with opacity and line style issues fixed. A new point editor added into the designer (double-click the MapView to activate) but largely irrelevant to this particular thread. ---------------------------------------------------------------------- MarkMLl · 2024-07-16 17:26 Thanks, I'll take a look. Demo program based on Barkway attached. Not sure whether you're interested, but also illustrates the problem I describe at https://forum.lazarus.freepascal.org/index.php/topic,67908 .msg523761.html#msg523761 ... my code's fairly sloppy but there's some sign errors in there I've not tracked down. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-07-18 08:55 Appears OK as of r9394, although it's still safest to set the area's bounding line colour explicitly even if that is to clNone. If that is not done then it inherits from the body colour of the last-drawn area, and since the opacity is 100% this tends to be obtrusive. (Note that I'm not complaining, just commenting on how it appears best to use this tool). I've slimmed my example down by moving the perimeter stuff into a separate unit, and attach the result as a useful demo. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-18 10:19 Quote from: MarkMLl on July 18, 2024, 10:55:11 amAppears OK as of r9394, although it's still safest to set the area's bounding line colour explicitly even if that is to clNone. If that is not done then it inherits from the body colour of the last-drawn area, and since the opacity is 100% this tends to be obtrusive. (Note that I'm not complaining, just commenting on how it appears best to use this tool). Please complain, I'm glad to receive any feedback about LMV. I would like to fix all that 'side-effects' appearing. Any additions as the opacity makes regressions inevitable and it would be nice when they're spotted to pinpoint them. FYI there is an additional processing to obtain the track width and color (in TMapView.DrawTrack) TMapView.TrackLineColor - when the track color is clDefault, it returns the MapView.DefaultTrackColor (or if there is an ExtraData -> ExtraData.Color, which is a kind of a legacy code left) TMapView.TrackLineWidth - when the track width is -1, it returns the MapView.DefaultTrackWidth (or if there is an ExtraData -> ExtraData.Width, same legacy)Please note that the track width is in mm, not pixels, i.e. = x / 25.4 * ScreenInfo.PixelsPerInchX I'm surprised that you're observing such a color 'transfer' between objects, there shouldn't be because of the above explained processing, anyway can you tell me what combination of props will show it? There was such a transfer of opacity, hope it is now fixed. Quote from: MarkMLl on July 18, 2024, 10:55:11 amI've slimmed my example down by moving the perimeter stuff into a separate unit, and attach the result as a useful demo. Thank you! I was under impression that the polygon buffering is a something needed for your project, not for the demo itself. I'm not sure it will be valued enough, if noticed at all, when it is executed just once and just shown. However, I hope it will be useful to you and for the forum participants, of course. ---------------------------------------------------------------------- MarkMLl · 2024-07-18 11:38 Quote from: alpine on July 18, 2024, 12:19:35 pmI'm surprised that you're observing such a color 'transfer' between objects, there shouldn't be because of the above explained processing, anyway can you tell me what combination of props will show it? There was such a transfer of opacity, hope it is now fixed. I can demonstrate it happening with r9384... do you need the details? QuoteI was under impression that the polygon buffering is a something needed for your project, not for the demo itself. I'm not sure it will be valued enough, if noticed at all, when it is executed just once and just shown. However, I hope it will be useful to you and for the forum participants, of course. The only thing that is going to be dynamic is aircraft moving along (and close to) the circuit, where it would be desirable if they could appear as distinctive blips along a track with the track+blips being removed in its entirety when the contact times out (i.e. has left the area, or turned off all systems after landing). I've got all the state transitions done which involved multiple caches and got a bit hairy. I believe that could be "interesting" since LMV itself doesn't support distinctive markers due to that sort of thing not being portable across drawing engines. Example at https://github.com/MarkMLl/utils1090/blob/main/1697961664a.png which was the result of several hours monitoring and plotting using QGIS, I'd expect far fewer live tracks ** but it would be desirable to have each distinctive. ** Finger-in-air guess: the airfield's breakfast "fly-in" last September probably had between a dozen and a score live aircraft at any time, including those idling on the ground. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-18 12:22 Quote from: MarkMLl on July 18, 2024, 01:38:11 pmQuote from: alpine on July 18, 2024, 12:19:35 pmI'm surprised that you're observing such a color 'transfer' between objects, there shouldn't be because of the above explained processing, anyway can you tell me what combination of props will show it? There was such a transfer of opacity, hope it is now fixed. I can demonstrate it happening with r9384... do you need the details?Yes please. Quote from: MarkMLl on July 18, 2024, 01:38:11 pmQuoteI was under impression that the polygon buffering is a something needed for your project, not for the demo itself. I'm not sure it will be valued enough, if noticed at all, when it is executed just once and just shown. However, I hope it will be useful to you and for the forum participants, of course. The only thing that is going to be dynamic is aircraft moving along (and close to) the circuit, where it would be desirable if they could appear as distinctive blips along a track with the track+blips being removed in its entirety when the contact times out (i.e. has left the area, or turned off all systems after landing). I've got all the state transitions done which involved multiple caches and got a bit hairy. I believe that could be "interesting" since LMV itself doesn't support distinctive markers due to that sort of thing not being portable across drawing engines. Example at https://github.com/MarkMLl/utils1090/blob/main/1697961664a.png which was the result of several hours monitoring and plotting using QGIS, I'd expect far fewer live tracks ** but it would be desirable to have each distinctive. Have you seen the "flights" example into the LMV? It is different scale/zoom there but similar as moving some blobs around a flight tracks in a timely manner. Also, now there are OnDrawPoint/OnDrawTrack/OnDrawArea events for POI/Track/Area resp. (see the OI) You can always inherit from TGPSObj (or descendant) and override its GetArea and Draw methods. You'll be restricted to the TMvCustomDrawingEngine capabilities of course. ---------------------------------------------------------------------- MarkMLl · 2024-07-18 12:56 Quote from: alpine on July 18, 2024, 02:22:19 pm{quote]I can demonstrate it happening with r9384... do you need the details?Yes please. [/quote] See attached, note line 127 in maincode.pas which- if commented out- causes the yellow area to inherit red outline from the preceding area. QuoteHave you seen the "flights" example into the LMV? It is different scale/zoom there but similar as moving some blobs around a flight tracks in a timely manner. Also, now there are OnDrawPoint/OnDrawTrack/OnDrawArea events for POI/Track/Area resp. (see the OI) You can always inherit from TGPSObj (or descendant) and override its GetArea and Draw methods. You'll be restricted to the TMvCustomDrawingEngine capabilities of course. I'll take another look once I've finished the current crop of message processing etc. MarkMLl ---------------------------------------------------------------------- alpine · 2024-07-18 13:34 Quote from: MarkMLl on July 18, 2024, 02:56:51 pmQuote from: alpine on July 18, 2024, 02:22:19 pmQuoteI can demonstrate it happening with r9384... do you need the details?Yes please. See attached, note line 127 in maincode.pas which- if commented out- causes the yellow area to inherit red outline from the preceding area. According to the explanation in reply #33 - since the scratchArea  just created at line #117, it has LineColor=clDefault and thus inherits its value from the MapView.DefaultTrackColor (by design), which coincidentally is clRed also.This misleads you into thinking that the color of the "avoids" area has affected the "perimeter" area. ---------------------------------------------------------------------- MarkMLl · 2024-07-18 14:38 Quote from: alpine on July 18, 2024, 03:34:52 pmwhich coincidentally is clRed also. Ah :-) MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-08-04 10:35 Updated version of my demo program attached. I admit that I've been sweating blood getting the geometry sorted out, but my variant of the code that expands the circuit track to a slightly larger area now works correctly with both clockwise and anticlockwise vertex ordering and has adequate handling of reentrant corners. Principle of operation is to expand along the mean angle at each vertex with a fudge factor on the length, as an alternative there's code in there that expands along track normals but that really doesn't like reentrants. I don't think it folds in your most recent changes at https://forum.la zarus.freepascal.org/index.php/topic,67908.msg524478.html#msg524478 Obviously all the juicy maths is in a separate unit so as not to detract from the example showing runtime creation of areas etc.. Feel free to fold it into LMV with the same license etc. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2024-08-07 07:26 Final update attached. This sorts out problems in the code to scale along normals, but uses a fudge factor to get something visually acceptable where a vertex (corner of the circuit pattern) is reentrant. Potential enhancements would be to eliminate reentrants (which are probably handled adequately, at least by scaling along mean angles rather than normals) and to combine multiple circuits into a single outline. However it's most unlikely that I will attempt either of these in the context of this demo program. MarkMLl ---------------------------------------------------------------------- verasan · 2025-03-20 17:26 I'm new with LazMapViewer...I just installed it already ...when I try it TMapView's MapProvider property is fix in OpenStreetMap Mapnik and not allow me change it....any help? ---------------------------------------------------------------------- MarkMLl · 2025-03-20 18:29 Quote from: verasan on March 20, 2025, 06:26:10 pmI'm new with LazMapViewer...I just installed it already ...when I try it TMapView's MapProvider property is fix in OpenStreetMap Mapnik and not allow me change it....any help? Start a new topic with an appropriate subject line rather than necroposting on top of a specialised discussion. Also make sure you include details of the OS you're using, Lazarus version and so on. MarkMLl