MapFragment
Class used for drawing a 2gis map.
()
Class used for drawing a 2gis map.
(apiKey, center, maxZoom, minZoom, zoom, maxPitch, minPitch, pitch, rotation, controls, disablePitchByUserInteraction, disableRotationByUserInteraction, autoHideOSMCopyright, style, styleZoom, defaultBackgroundColor, maxBounds, padding, language)
Called to set initial values of the map.
apiKey
String
The private key map.
center
LonLat
Map center in geographical coordinates (longitude,latitude).
maxZoom
Double
Maximum map zoom.
minZoom
Double
Minimum map zoom.
zoom
Double
Map zoom.
maxPitch
Double
Maximum map pitch in degrees.
minPitch
Double
Minimum map pitch in degrees.
pitch
Double
Map pitch in degrees.
rotation
Double
Map rotation in degrees.
controls
Boolean
Whether a zoom control should be added during the map initialization.
disablePitchByUserInteraction
Boolean
Prevent users from pitching a map.
disableRotationByUserInteraction
Boolean
Prevent users from rotating a map.
autoHideOSMCopyright
Boolean
Enable OSM copyright auto hide after 5 sec.
style
StyleId?
Set style id.
styleZoom
Double?
Map style zoom. Use this option if you want to set the same zoom that is used in the style settings. The styleZoom and zoom options set the same map scale but in different projections. If both options are set, the styleZoom has a higher priority than the zoom option.
defaultBackgroundColor
Int?
Set default background color, while style is loading.
maxBounds
LonLatBounds?
The map will be constrained to the given bounds, if set.
padding
language
String
The desired map language. Short language code "en", "ru", etc.
mapReadyCallback
Callback for the result when map is ready.