Hello,
I am creating a UniMap at runtime and trying to add a marker to it, but UniForm is not loading.
procedure CreateMap(upanel: TUniPanel; lat, longt: Double);
var
umap: TUniMap;
begin
umap := TUniMap.Create(upanel);
umap.Parent := upanel;
umap.Align := alTop;
umap.Height := 250;
umap.LayoutConfig.Margin := '10 10 10 10';
with umap.MapLayers.Add do
begin
LayerType := mlGoogle;
MapType := mtRoadMap;
end;
umap.DefaultLat := lat;
umap.DefaultLong := longt;
umap.DefaultZoom := 15;
with umap.Markers.Add do
begin
id:= 1;
Latitude:= lat;
Longitude:= longt;
Icon.iconUrl := 'images/icons/marker-icon.png';
Draggable:= True;
AddToMap;
PanToMarker(15);
end;
end;
If I am not adding marker, uniform, and unimap load properly.
I want that marker is shown on the unimap straight after creation (not after some event, like onclick, etc.). Is this possible? How to achieve this?
Thank You.