1 (edited by brian.zaballa 2019-08-20 08:12:40)

Topic: Map Marker, Route and Area

Good Day Wizards. I'm having problem on rendering Routes and Area.
Some of the routes seems fine (overlapping the area) but there are times other routes don't.
I am rendering maps(area, route and marker) via script. I already tried loading all routes after loading area but the result is the same.
Is there any way to correct this
Markers must overlap routes, and routes must overlap area.
Thanks in advance

Post's attachments

Attachment icon map.png 419.97 kb, 149 downloads since 2019-08-20 

brian

Re: Map Marker, Route and Area

Please attach your project. I will check.

Dmitry.

Re: Map Marker, Route and Area

DriveSoft wrote:

Please attach your project. I will check.

Thanks for the fast reply.
Here, i made some sample of the code.

Post's attachments

Attachment icon test.zip 395.88 kb, 309 downloads since 2019-09-01 

brian

Re: Map Marker, Route and Area

procedure LoadPolygons(Results:TDataSet; aOpacity:integer; aWidth:integer; aLineCol:integer);
var
    sNumber : String;
begin
    sNumber := '';
    // show
    while not Results.EOF do begin
      if sNumber <> Results.FieldByName('number').asString then begin

        if PolygonItemRegion <> nil then begin // create/add
            Form1.Map1.CreateMapPolygon(PolygonItemRegion.Polygon);
        end;

        PolygonItemRegion := Form1.Map1.Polygons.Add;

        if not Results.FieldByName('Color').IsNull then begin
            PolygonItemRegion.Polygon.BackgroundColor := Results.FieldByName('Color').AsInteger; //The color of the polygon.
            PolygonItemRegion.Polygon.HoverBackgroundColor := Results.FieldByName('Color').AsInteger;  //The color of the polygon when hovered
            PolygonItemRegion.Polygon.HoverBorderColor := clblue;  //The border color of the polygon when hovered
        end;

        PolygonItemRegion.Polygon.Editable:= false;
        PolygonItemRegion.Polygon.BackgroundOpacity := aOpacity;
        PolygonItemRegion.Polygon.BorderWidth := aWidth;
        PolygonItemRegion.Polygon.BorderColor := aLineCol;
        PolygonItemRegion.Polygon.Tag := Results.FieldByName('mapID').asInteger;
        PolygonItemRegion.Polygon.ZIndex := 0; // <<<-----  add this line
      end;

      sNUmber := Results.FieldByName('number').asString;
      PolygonItemRegion.Polygon.Path.Add(Results.FieldByName('Latitude').AsFloat, Results.FieldByName('Longitude').AsFloat);
      Results.Next;
    end;
    Results.Free;
end;
Dmitry.

Re: Map Marker, Route and Area

Wow! That zIndex solves the problem.
You are a life saver Dmitry.

Thanks much Drivesoft.

brian