MBMMap.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <CoreLocation/CoreLocation.h>
  4. #import <MapboxCoreMaps/MBMConstrainMode.h>
  5. #import <MapboxCoreMaps/MBMMapDebugOptions.h>
  6. #import <MapboxCoreMaps/MBMNorthOrientation.h>
  7. #import <MapboxCoreMaps/MBMViewportMode.h>
  8. @class MBXExpected<__covariant Value, __covariant Error>;
  9. @class MBXFeature;
  10. #import <MapboxCoreMaps/MBMCameraManager.h>
  11. @class MBMMapMemoryBudget;
  12. @class MBMMapOptions;
  13. @class MBMRenderCacheOptions;
  14. @class MBMRenderedQueryGeometry;
  15. @class MBMRenderedQueryOptions;
  16. @class MBMResourceOptions;
  17. @class MBMScreenBox;
  18. @class MBMScreenCoordinate;
  19. @class MBMSize;
  20. @class MBMSourceQueryOptions;
  21. @class MBMViewAnnotationOptions;
  22. @class MBXCancelable;
  23. @protocol MBMMapClient;
  24. @protocol MBMViewAnnotationPositionsUpdateListener;
  25. /**
  26. * Map class provides map rendering functionality.
  27. *
  28. */
  29. NS_SWIFT_NAME(Map)
  30. __attribute__((visibility ("default")))
  31. @interface MBMMap : MBMCameraManager
  32. // This class provides custom init which should be called
  33. - (nonnull instancetype)init NS_UNAVAILABLE;
  34. // This class provides custom init which should be called
  35. + (nonnull instancetype)new NS_UNAVAILABLE;
  36. /**
  37. * Creates the infrastructure needed for rendering the map.
  38. * It should be called before any call to `render` method. Must be called on the render thread.
  39. */
  40. - (void)createRenderer;
  41. /**
  42. * Destroys the infrastructure needed for rendering the map, releasing resources.
  43. * Must be called on the render thread.
  44. */
  45. - (void)destroyRenderer;
  46. /** Renders the map. */
  47. - (void)render;
  48. /**
  49. * Sets the size of the map.
  50. * @param size The new `size` of the map in `platform pixels`.
  51. */
  52. - (void)setSizeForSize:(nonnull MBMSize *)size;
  53. /**
  54. * Gets the size of the map.
  55. *
  56. * @return The `size` of the map in `platform pixels`.
  57. */
  58. - (nonnull MBMSize *)getSize __attribute((ns_returns_retained));
  59. /** Triggers a repaint of the map. */
  60. - (void)triggerRepaint;
  61. /**
  62. * Tells the map rendering engine that there is currently a gesture in progress. This
  63. * affects how the map renders labels, as it will use different texture filters if a gesture
  64. * is ongoing.
  65. *
  66. * @param inProgress The `boolean` value representing if a gesture is in progress.
  67. */
  68. - (void)setGestureInProgressForInProgress:(BOOL)inProgress;
  69. /**
  70. * Returns `true` if a gesture is currently in progress.
  71. *
  72. * @return `true` if a gesture is currently in progress, `false` otherwise.
  73. */
  74. - (BOOL)isGestureInProgress;
  75. /**
  76. * Tells the map rendering engine that the animation is currently performed by the
  77. * user (e.g. with a `setCamera` calls series). It adjusts the engine for the animation use case.
  78. * In particular, it brings more stability to symbol placement and rendering.
  79. *
  80. * @param inProgress The `boolean` value representing if user animation is in progress
  81. */
  82. - (void)setUserAnimationInProgressForInProgress:(BOOL)inProgress;
  83. /**
  84. * Returns `true` if user animation is currently in progress.
  85. *
  86. * @return `true` if a user animation is currently in progress, `false` otherwise.
  87. */
  88. - (BOOL)isUserAnimationInProgress;
  89. /**
  90. * When loading a map, if prefetch zoom `delta` is set to any number greater than 0,
  91. * the map will first request a tile at zoom level lower than `zoom - delta`, with requested
  92. * zoom level a multiple of `delta`, in an attempt to display a full map at lower resolution as quick as possible.
  93. *
  94. * @param delta The new prefetch zoom delta.
  95. */
  96. - (void)setPrefetchZoomDeltaForDelta:(uint8_t)delta;
  97. /**
  98. * Returns the map's prefetch zoom delta.
  99. *
  100. * @return The map's prefetch zoom `delta`.
  101. */
  102. - (uint8_t)getPrefetchZoomDelta;
  103. /** Sets the north `orientation mode`. */
  104. - (void)setNorthOrientationForOrientation:(MBMNorthOrientation)orientation;
  105. /** Sets the map `constrain mode`. */
  106. - (void)setConstrainModeForMode:(MBMConstrainMode)mode;
  107. /** Sets the `viewport mode`. */
  108. - (void)setViewportModeForMode:(MBMViewportMode)mode;
  109. /**
  110. * Returns the `map options`.
  111. *
  112. * @return The map's `map options`.
  113. */
  114. - (nonnull MBMMapOptions *)getMapOptions __attribute((ns_returns_retained));
  115. /**
  116. * Returns the `map debug options`.
  117. *
  118. * @return An array of `map debug options` flags currently set to the map.
  119. */
  120. - (nonnull NSArray<NSNumber *> *)getDebug __attribute((ns_returns_retained));
  121. /**
  122. * Sets the `map debug options` and enables debug mode based on the passed value.
  123. *
  124. * @param debugOptions An array of `map debug options` to be set.
  125. * @param value A `boolean` value representing the state for a given `map debug options`.
  126. *
  127. */
  128. - (void)setDebugForDebugOptions:(nonnull NSArray<NSNumber *> *)debugOptions
  129. value:(BOOL)value;
  130. /**
  131. * Returns `true` when the map is completely rendered, `false` otherwise. A partially
  132. * rendered map ranges from nothing rendered at all to only labels missing.
  133. *
  134. * @return `true` when the map is completely rendered, `false` otherwise.
  135. *
  136. */
  137. - (BOOL)isMapLoaded;
  138. /**
  139. * Updates the state object of a feature within a style source.
  140. *
  141. * Update entries in the `state` object of a given feature within a style source. Only properties of the
  142. * `state` object will be updated. A property in the feature `state` object that is not listed in `state` will
  143. * retain its previous value. The properties must be paint properties, layout properties are not supported.
  144. *
  145. * Note that updates to feature `state` are asynchronous, so changes made by this method migth not be
  146. * immediately visible using `getStateFeature`. And the corresponding source needs to be in use to ensure the
  147. * feature data it contains can be successfully updated.
  148. *
  149. * @param sourceId The style source identifier.
  150. * @param sourceLayerId The style source layer identifier (for multi-layer sources such as vector sources).
  151. * @param featureId The feature identifier of the feature whose state should be updated.
  152. * @param state The `state` object with properties to update with their respective new values.
  153. */
  154. - (void)setFeatureStateForSourceId:(nonnull NSString *)sourceId
  155. sourceLayerId:(nullable NSString *)sourceLayerId
  156. featureId:(nonnull NSString *)featureId
  157. state:(nonnull id)state;
  158. /**
  159. * Removes entries from a feature state object.
  160. *
  161. * Remove a specified property or all property from a feature's state object, depending on the value of
  162. * `stateKey`.
  163. *
  164. * Note that updates to feature state are asynchronous, so changes made by this method migth not be
  165. * immediately visible using `getStateFeature`.
  166. *
  167. * @param sourceId The style source identifier.
  168. * @param sourceLayerId The style source layer identifier (for multi-layer sources such as vector sources).
  169. * @param featureId The feature identifier of the feature whose state should be removed.
  170. * @param stateKey The key of the property to remove. If `null`, all feature's state object properties are removed.
  171. */
  172. - (void)removeFeatureStateForSourceId:(nonnull NSString *)sourceId
  173. sourceLayerId:(nullable NSString *)sourceLayerId
  174. featureId:(nonnull NSString *)featureId
  175. stateKey:(nullable NSString *)stateKey;
  176. /** Reduces memory use. Useful to call when the application gets paused or sent to background. */
  177. - (void)reduceMemoryUse;
  178. /**
  179. * Gets the resource options for the map.
  180. *
  181. * All optional fields of the retuned object are initialized with the actual values.
  182. *
  183. * Note that result of this method is different from the `resource options` that were provided to the map's constructor.
  184. *
  185. * @return The `resource options` for the map.
  186. */
  187. - (nonnull MBMResourceOptions *)getResourceOptions __attribute((ns_returns_retained));
  188. /**
  189. * Gets elevation for the given coordinate.
  190. * Note: Elevation is only available for the visible region on the screen.
  191. *
  192. * @param coordinate The `coordinate` defined as longitude-latitude pair.
  193. * @return The elevation (in meters) multiplied by current terrain exaggeration, or empty if elevation for the coordinate is not available.
  194. */
  195. - (nullable NSNumber *)getElevationForCoordinate:(CLLocationCoordinate2D)coordinate __attribute((ns_returns_retained));
  196. /**
  197. * Enables or disables the experimental render cache feature.
  198. *
  199. * Render cache is an experimental feature aiming to reduce resource usage of map rendering
  200. * by caching intermediate rendering results of tiles into specific cache textures for reuse between frames.
  201. * Performance benefit of the cache depends on the style as not all layers are cacheable due to e.g.
  202. * viewport aligned features. Render cache always prefers quality over performance.
  203. *
  204. * @param options The `render cache options` defining the render cache behavior.
  205. */
  206. - (void)setRenderCacheOptionsForOptions:(nonnull MBMRenderCacheOptions *)options;
  207. /**
  208. * Returns the `render cache options` used by the map.
  209. *
  210. * @return The `render cache options` currently used by the map.
  211. */
  212. - (nonnull MBMRenderCacheOptions *)getRenderCacheOptions __attribute((ns_returns_retained));
  213. @end