24.10.2014 Views

TMS iCL DEVELOPERS GUIDE - TMS Software

TMS iCL DEVELOPERS GUIDE - TMS Software

TMS iCL DEVELOPERS GUIDE - TMS Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>TMS</strong> SOFTWARE<br />

<strong>TMS</strong> <strong>iCL</strong><br />

<strong>DEVELOPERS</strong> <strong>GUIDE</strong><br />

Adding Overlays<br />

Overlays are shapes that can be added to the map, there are different kinds of overlays, and each<br />

ovelay can be configured in stroke and fill color and opacity. The MapView exposes an overlay<br />

collection and a couple of functions that can be used to add an overlay to the map. Currently, a<br />

circle, polygon and polyline can be added to the MapView. Below is a sample of a circle and a<br />

polyline that is added to the MapView. Note that the code is wrapped with a BeginUpdate and<br />

EndUpdate. This is crucial to make sure the overlay shape has the correct position, and appearance<br />

when added.<br />

//Center circle with 500 km radius<br />

<strong>TMS</strong>FMXNativeMKMapView1.BeginUpdate;<br />

c :=<br />

<strong>TMS</strong>FMXNativeMKMapView1.AddCircle(<strong>TMS</strong>FMXNativeMKMapView1.XYToCoordinate(<strong>TMS</strong>F<br />

MXNativeMKMapView1.Width / 2,<br />

<strong>TMS</strong>FMXNativeMKMapView1.Height / 2), 500000);<br />

c.LineWidth := 3;<br />

c.LineColor := TAlphaColorRec.Greenyellow;<br />

c.Color := TAlphaColorRec.Darkgoldenrod;<br />

c.Opacity := 0.5;<br />

c.LineOpacity := 0.5;<br />

<strong>TMS</strong>FMXNativeMKMapView1.EndUpdate;<br />

//Bermuda triangle<br />

<strong>TMS</strong>FMXNativeMKMapView1.BeginUpdate;<br />

71

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!