TTMSFNCMapBoxOptions Class
Configures provider-specific options for a Mapbox map instance.
API unit family: TMSFNCMapBox
Inherits from: TTMSFNCMapsOptions
Syntax
TTMSFNCMapBoxOptions = class(TTMSFNCMapsOptions)
class PASCALIMPLEMENTATION TTMSFNCMapBoxOptions : public TTMSFNCMapsOptions
Properties
| Name | Description |
|---|---|
| Heading | Sets the map heading in degrees. |
| MapStyle | Selects the visual map style. |
| MapStyleURL | Specifies the custom style URL used when MapStyle is mbsCustom. |
| Tilt | Sets the camera tilt angle. |
| TimeOfDay | Sets the lighting time of day for compatible 3D map styles. |
| Version | Specifies the provider library version loaded by the map. |
Usage examples
Configure MapBox 3D camera options
Sets the 3D MapBox style, time of day, tilt and heading.
procedure TForm1.ConfigureMapBox3DCamera;
begin
TMSFNCMapBox1.Options.MapStyle := mbs3D;
TMSFNCMapBox1.Options.TimeOfDay := todDusk;
TMSFNCMapBox1.Options.Tilt := 60;
TMSFNCMapBox1.Options.Heading := 35;
end;
Configure style, camera and labels
Sets the MapBox API version, style URL, 3D camera options, time of day and a map label.
procedure TForm1.ConfigureMapBoxStyleAndCamera;
var
LLabel: TTMSFNCMapsLabel;
begin
TMSFNCMapBox1.APIKey := '<your MapBox access token>';
{ API version updated to v3.24.0: pin the provider version you tested. }
TMSFNCMapBox1.Options.Version := '3.24.0';
{ MapStyles can use a built-in style or a predefined custom style URL. }
TMSFNCMapBox1.Options.MapStyle := mbsCustom;
TMSFNCMapBox1.Options.MapStyleURL := 'mapbox://styles/mapbox/streets-v12';
{ Support for 3D Maps. }
TMSFNCMapBox1.Options.MapStyle := mbs3D;
{ Options TimeOfDay, Tilt and Heading control 3D maps only. }
TMSFNCMapBox1.Options.TimeOfDay := todDusk;
TMSFNCMapBox1.Options.Tilt := 60;
TMSFNCMapBox1.Options.Heading := 35;
TMSFNCMapBox1.Options.DefaultLatitude := 40.7073;
TMSFNCMapBox1.Options.DefaultLongitude := -74.0093;
TMSFNCMapBox1.Options.DefaultZoomLevel := 15;
{ Labels collection is now accessible. }
LLabel := TMSFNCMapBox1.Labels.Add;
LLabel.Text := 'Downtown';
LLabel.Coordinate.Latitude := 40.7073;
LLabel.Coordinate.Longitude := -74.0093;
LLabel.LabelType := ltBalloon;
end;