Page 1 of 1

Singapore

Posted: Wed Feb 02, 2011 3:00 pm
by 16658334
Would it be possible for you to update your ActiveX map control to include the country of Singapore? I know it is a very small country and perhaps difficult to add because of this, but it is a very important country in terms of world trade. The application I am building concerns world-wide shipping and the port of Singapore is an important world player in this regard.

Re: Singapore

Posted: Thu Feb 03, 2011 2:32 pm
by yeray
Hi AccessCoder,

I'm not sure if you are trying to do something similar to the described here.
I can see the island in the World map. Maybe you want a label for that island?

Code: Select all

Series1[1839].Text:='Singapore';
If that's not what you are trying to do, please try to explain it to us in detail.

Re: Singapore

Posted: Thu Feb 03, 2011 3:27 pm
by 16658334
Thanks Yeray. I'm not sure where the polygon 1839 is on the world map but it's not where Singapore is. Singapore is not an island. It's a place on the tip of the Malaysian peninsula (I spotted it on Google Map :-) ). I added the .text property to 1839 but I can't see where this polygon is. Also, it doesn't appear on the Asia map either and that is where it would be the most useful. How do I go about adding a polygon for Singapore?

Re: Singapore

Posted: Thu Feb 03, 2011 4:33 pm
by yeray
Hi AccessCoder,

Well, it's not an island but in TeeChart it looks like one... :oops:
Here it is in Google Maps:
SingaporeG.png
SingaporeG.png (82.09 KiB) Viewed 14127 times
And here it is with the following code in TeeChart:

Code: Select all

uses TeeWorldSeries;

var Series1: TWorldSeries;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  Series1:=Chart1.AddSeries(TWorldSeries) as TWorldSeries;
  Series1.Map := wmWorld;

  Series1[1839].Text:='Singapore';
  Series1[1839].Color:=clRed;

  Series1.Marks.Visible:=true;
  Series1.OnGetMarkText:=Series1GetMarkText;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer; var MarkText: String);
begin
  if Series1[ValueIndex].Text <> 'Singapore' then
    MarkText:='';
end;
Singapore.png
Singapore.png (12.98 KiB) Viewed 14143 times
AccessCoder wrote:Also, it doesn't appear on the Asia map either and that is where it would be the most useful. How do I go about adding a polygon for Singapore?
You're right, it only appears in the World map and should also appear in the Asia map. I've added it to the defect list to be implemented in future releases (TV52015380).
So what you would like is to ad that polygon into the Asia map?

Re: Singapore

Posted: Thu Feb 03, 2011 6:08 pm
by 16658334
Thanks Yeray

My may doesn't look nearly as nice as yours when I use TCommander to zoom in:
Image
What am I doing wrong? Also I still can't identify Singapore on my map. Here is the code I am using to turn on some colors. Malaysia and Indonesia show up but Singapore doesn't:

Code: Select all

Private Sub cboMap_AfterUpdate()

Dim i As Long, lngColor As Long
  Select Case cboMap.Value
    Case 0: TChart0.Series(0).asWorld.Map = 0 'wmWorld
            TChart0.Series(0).asMap.Shapes.Polygon(1839).Text = "Singapore"
            TChart0.Series(0).asMap.Shapes.Polygon(1839).Color = vbRed
            TChart0.Series(0).asMap.Shapes.Polygon(1087).Color = vbGreen
            TChart0.Series(0).asMap.Shapes.Polygon(1385).Color = vbBlue
    Case 1: TChart0.Series(0).asWorld.Map = 1 'wmAfrica
    Case 2: TChart0.Series(0).asWorld.Map = 2 'wmAsia
    Case 3: TChart0.Series(0).asWorld.Map = 3 ' wmAustralia
    Case 4: TChart0.Series(0).asWorld.Map = 4 'wmCentralAmerica
    Case 5: TChart0.Series(0).asWorld.Map = 5 'wmEurope
    Case 6: TChart0.Series(0).asWorld.Map = 6 'wmEurope15
    Case 7: TChart0.Series(0).asWorld.Map = 7 'wmEurope27
    Case 8: TChart0.Series(0).asWorld.Map = 8 'wmSpain
    Case 9: TChart0.Series(0).asWorld.Map = 9 'wmMiddleEast
    Case 10: TChart0.Series(0).asWorld.Map = 10 'wmNorthAmerica
    Case 11: TChart0.Series(0).asWorld.Map = 11 'wmSouthAmerica
    Case 12: TChart0.Series(0).asWorld.Map = 12 'wmUSA
    Case 13: TChart0.Series(0).asWorld.Map = 13 'wmUSAHawaiiAlaska
  End Select
Also, could you please help me to draw Singapore on the Asia map?
Thanks very much!

Re: Singapore

Posted: Mon Feb 07, 2011 12:37 pm
by 10050769
Hello AccessCoder,
My may doesn't look nearly as nice as yours when I use TCommander to zoom in:
I could reproduce your problem here and I have added your request in bug list report with number [TV52015383]. We will try to fix it for next maintenance releases of TeeChartVCL.
What am I doing wrong? Also I still can't identify Singapore on my map. Here is the code I am using to turn on some colors. Malaysia and Indonesia show up but Singapore doesn't:
I recommend that you change lines of code there are below:

Code: Select all

 TChart0.Series(0).asMap.Shapes.Polygon(1839).Text = "Singapore"
TChart0.Series(0).asMap.Shapes.Polygon(1839).Color = vbRed
TChart0.Series(0).asMap.Shapes.Polygon(1087).Color = vbGreen
TChart0.Series(0).asMap.Shapes.Polygon(1385).Color = vbBlue
To this lines of code:

Code: Select all

TChart0.Series(0).PointLabel(1839) = "Singapore"
TChart0.Series(0).PointColor(1839) = vbRed
TChart0.Series(0).PointColor(1087) = vbGreen
TChart0.Series(0).PointColor(1385) = vbBlue
When you have changed your code, please tell us if our suggestion solve your problem.

Thanks,

Re: Singapore

Posted: Tue Feb 08, 2011 9:28 am
by 16658334
Thank you Sandra
I tried the replacement code but I get the same results. I look forward to the patch that you mentioned, however I am using TeeChart ActiveX, not TeeChart VCL. Hopefully the patch will be applied to the ActiveX version as well? Will I be notified when a patch is available? Thanks again, I appreciate your help.
Kind regards
AccessCoder

Re: Singapore

Posted: Tue Feb 08, 2011 11:01 am
by 10050769
Hello AccessCoder,
I tried the replacement code but I get the same results.
Could you tell us which version of TeeChart Activex are you using now?
I look forward to the patch that you mentioned, however I am using TeeChart ActiveX, not TeeChart VCL. Hopefully the patch will be applied to the ActiveX version as well?
This is a TeeChart VCL bug too. Please notice that the ActiveX version is a COM wrapper of the VCL version so it will have to be fixed in the VCL version before making into an ActiveX release. Hopefully it will be fixed for the next VCL maintenance release.
Will I be notified when a patch is available?
I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's fixed on them.

Thanks,

Re: Singapore

Posted: Wed Feb 09, 2011 9:11 am
by 16658334
Hi Sandra
My .ocx control version is 2010.0.0.2 and I bought it around a month ago. I will watch for the new version release. The problem only seems to happen on the world map but the regional maps are ok. Would it be possible for you to show me how to draw Singapore on the Asia map?
Thanks again for your help
AccessCoder

Re: Singapore

Posted: Thu Feb 10, 2011 10:28 am
by 10050769
Hello AccessCoder,
Would it be possible for you to show me how to draw Singapore on the Asia map?
I am afraid that for now there isn't a good workaround for this bug (TV52015380). So you should wait next maintenance releases, if it is fixed in these or you can take a look in this link http://www.teechart.net/support/viewtop ... les#p10106 where explain that are files *shp. My recommendation is that try to find a ESRI FILES (.shp) of Map of Asia where appears Singapore as a workaround for now.

Remember to be aware at this forum or our RSS news feed, twitter and facebook accounts for new release announcements and what's fixed on them.

Thanks,