Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TMS iCL
Add a custom pin image annotation to the TTMSFMXNativeMKMapView
Add a custom pin image annotation to the TTMSFMXNativeMKMapView
The following code can be used to show a custom pin image when adding an annotation to the mapview component.
The annotation is added to the center of the Map based on an image that has been added to the root folder in the deployment window.
var loc: TTMSFMXNativeMKMapLocation; ann: TTMSFMXNativeMKAnnotation; begin TMSFMXNativeMKMapView1.BeginUpdate; loc := TMSFMXNativeMKMapView1.XYToCoordinate(TMSFMXNativeMKMapView1.Width / 2, TMSFMXNativeMKMapView1.Height / 2); ann := TMSFMXNativeMKMapView1.AddAnnotation(loc, 'Hello', 'World'); ann.Bitmap.LoadFromFile(ExtractFilePath(ParamStr(0))+'pin.png'); TMSFMXNativeMKMapView1.EndUpdate;