Hello group.
I hope someone can help me with this problem I'm having with AddAnnotation method with DPFMapView
I generate 100 random Latitude and Longitude values and add those points to a MapView with an image icon as the Map Point.
The problem is the image does not show right away. The pin shows. After I zoom in and back out a few times, the image icons finally start to show up on the map slowly.
I would like for the image icons to show up immediately instead of the pins.
I hope someone can tell me how to fix it.
Regards,
Bryan
P.S. I did not see where I could add attachments for some reason... it was there before.
Anyway, here's the unit.
Just add a DPFMapView to the form and drop a button on the map.
Since I cannot attach the sample program, you will have to add a sample small icon to the deployment and set the remote path to ".\Documents\"
Also you may have to rename the "Earthquake.png" below to whatever you named the sample icon file.
// Important for performance
procedure TForm1.PaintRects( const UpdateRects: array of TRectF );
begin
{ }
end;
// Important for performance
procedure TForm1.DPFButton1Click(Sender: TObject);
Function GenerateRandomLat : Double;
begin
Result := RandomRange(-60, 60);
end;
Function GenerateRandomLon : Double;
begin
Result := RandomRange(-179, 179);
end;
var
MKPoint : MKPointAnnotation;
x : Integer;
begin
for x := 0 to 100 do
begin
MKPoint:= Map.AddAnnotation('test',
'test comments',
GenerateRandomLat,
GenerateRandomLon,
-1,
'',
false,
1,
pcRed,
'/Documents/Earthquake.png',
'',
true,
false);
end;
end;
procedure TForm1.FormOnShow( Sender: TObject );
begin
self.Active := true; // very important for no crashing
// Application.Terminate; // Important For Application Speed up Performance !!!
end;
end.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello group.
I hope someone can help me with this problem I'm having with AddAnnotation method with DPFMapView
I generate 100 random Latitude and Longitude values and add those points to a MapView with an image icon as the Map Point.
The problem is the image does not show right away. The pin shows. After I zoom in and back out a few times, the image icons finally start to show up on the map slowly.
I would like for the image icons to show up immediately instead of the pins.
I hope someone can tell me how to fix it.
Regards,
Bryan
P.S. I did not see where I could add attachments for some reason... it was there before.
Anyway, here's the unit.
Just add a DPFMapView to the form and drop a button on the map.
Since I cannot attach the sample program, you will have to add a sample small icon to the deployment and set the remote path to ".\Documents\"
Also you may have to rename the "Earthquake.png" below to whatever you named the sample icon file.
I was finally able to add an attachment.
No need to copy and paste the above code, you can just download and use the sample program.
Thanks for any suggestions.
Regards,
Bryan