Page 1 of 1

TWorldSeries - Pacific centered map

Posted: Mon May 21, 2018 2:06 pm
by 16581924
How can I use the TWorldSeries for a Pacific centered map, so that it uses 0 to 360 degrees instead of -180 to +180 degrees?

Re: TWorldSeries - Pacific centered map

Posted: Thu May 24, 2018 7:05 am
by yeray
Hello,

You could use two TWorldSeries. The first one to draw from 0 to 180 and the second one to draw from -180 to 0. Ie:

Code: Select all

uses TeeWorldSeries;

var Series1: TWorldSeries;

procedure TForm1.FormCreate(Sender: TObject);
var tmpSeries: TWorldSeries;
begin
  Chart1.View3D:=False;
  Chart1.Legend.Hide;

  Series1:=Chart1.AddSeries(TWorldSeries) as TWorldSeries;
  Series1.FillSampleValues();


  with Chart1.Axes.Bottom do
  begin
    EndPosition:=50;
    SetMinMax(0, 180);
  end;

  tmpSeries:=CloneChartSeries(Series1) as TWorldSeries;
  with Chart1.CustomAxes.Add do
  begin
    Horizontal:=True;
    StartPosition:=50;
    SetMinMax(-180, 0);
  end;
  tmpSeries.CustomHorizAxis:=Chart1.CustomAxes[0];

  tmpSeries.ParentChart:=nil;
  Chart1.AddSeries(tmpSeries);
end;
Project3_2018-05-24_09-04-45.png
Project3_2018-05-24_09-04-45.png (75.16 KiB) Viewed 9080 times

Re: TWorldSeries - Pacific centered map

Posted: Thu Jun 07, 2018 1:10 pm
by 16581924
Thanks,
How can I add a shortest distance line from a position in Australia to a position on the west coast of the US, for example from Sydney to San Francisco, using this Pacific centered map?

Re: TWorldSeries - Pacific centered map

Posted: Wed Jun 13, 2018 1:27 pm
by yeray
Hello,

Do you mean how to calculate the great-circle distance or do you mean how to choose between the distance of two points in the same series or from a series to the other? For the later, once you have both distances you only have to take the shortest.

If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.