ImageEn, unit iexVirtualBitmaps |
|
TIESlippyMap.LatitudeToBmpY
Declaration
function LatitudeToBmpY(lat: double): integer;
Description
Converts from latitude to bitmap vertical position.
This conversion depends on the current
Latitude,
Longitude,
PointPosition and
Zoom.
Parameter | Description |
lat | Latitude in decimal degrees |
// Save an image with pins drawn for GPS coordinates
const
Pin_Width = 40;
Pin_Height = 40;
var
i: integer;
idx: integer;
lat, lon: double;
x, y: integer;
fn: string;
begin
// Prompt for a filename
fn := ImageEnView1.IO.ExecuteSaveDialog();
if fn = '' then
exit;
// Hide changes from view
ImageEnView1.LockUpdate();
try
// Add pins as shape layers
for i := 0 to ImageEnMView1.MultiSelectedImagesCount - 1 do
begin
idx := ImageEnMView1.MultiSelectedImages[i];
lat := ImageEnMView1.MIO.Params[idx].EXIF_GPSLatitude;
lon := ImageEnMView1.MIO.Params[idx].EXIF_GPSLongitude;
x := map.LongitudeToBmpX(lon);
y := map.LatitudeToBmpY(lat);
ImageEnView1.LayersAdd( iesPinLeft, x, y - Pin_Height, Pin_Width, Pin_Height );
end;
// Save current image + layers to file
ImageEnView1.LayersSaveMergedTo( fn );
// Clean up
ImageEnView1.LayersClear(False);
finally
// Reenable ImageEnView1
ImageEnView1.UnlockUpdate();
end;
end;
See Also
◼BmpYToLatitude
◼BmpXToLongitude
◼LongitudeToBmpX