|
// Note: this is just parts of the unit to show what to "patch". Please refer to the readme.md in this gist |
|
|
|
unit FMX.Maps.iOS; |
|
|
|
interface |
|
|
|
{$SCOPEDENUMS ON} |
|
procedure RegisterMapService; |
|
|
|
implementation |
|
|
|
uses |
|
MapsHelper.iOS, // <---------- Add this |
|
System.Types, System.SysUtils, System.Generics.Collections, System.Classes, System.SyncObjs, System.Math, |
|
System.TypInfo, System.Messaging, Macapi.ObjectiveC, Macapi.ObjCRuntime, Macapi.Helpers, iOSapi.Foundation, |
|
iOSapi.CoreGraphics, iOSapi.UIKit, iOSapi.MapKit, iOSapi.CoreLocation, FMX.Types, FMX.Platform, FMX.Maps, FMX.Forms, |
|
FMX.Graphics, FMX.Surfaces, FMX.Platform.iOS, FMX.Helpers.iOS, System.UITypes, FMX.MultiResBitmap, FMX.Utils, |
|
FMX.ZOrder.iOS; |
|
|
|
// Code snipped |
|
|
|
procedure TMapKitMapView.InitMapView; |
|
|
|
// Code snipped |
|
|
|
begin |
|
if FMapView = nil then |
|
begin |
|
FMapView := TMKMapView.Create; |
|
FMapView.setHidden(True); |
|
FDelegate := TMapKitDelegate.Create(Self); |
|
FGestureDelegate := TMapViewGestureDelegate.Create(Self); |
|
AddTapRecognizer(FGestureDelegate); |
|
AddLongTapRecognizer(FGestureDelegate); |
|
end; |
|
SetGestureOptions; |
|
SetControlOptions; |
|
SetLayerOptions; |
|
TMapsHelper.MapView := FMapView; // <---------- Add this |
|
end; |
|
|
|
// Code snipped |
|
|
|
constructor TMapKitMapMarker.Create(const Descriptor: TMapMarkerDescriptor; const View: TMapKitMapView); |
|
begin |
|
inherited Create(Descriptor); |
|
FView := View; |
|
FAnnotation := TMKPointAnnotation.Wrap(TMKPointAnnotation.Alloc.init); |
|
FAnnotation.setCoordinate(CLLocationCoordinate2D(Descriptor.Position)); |
|
FAnnotation.setTitle(StrToNSStr(Descriptor.Title)); |
|
FAnnotation.setSubtitle(StrToNSStr(Descriptor.Snippet)); |
|
TMapsHelper.Annotation := FAnnotation; // <------- Add this |
|
end; |
|
|