MBMProjection.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <CoreLocation/CoreLocation.h>
  4. @class MBMMercatorCoordinate;
  5. @class MBMProjectedMeters;
  6. /** Collection of [Spherical Mercator](http://docs.openlayers.org/library/spherical_mercator.html) projection methods. */
  7. NS_SWIFT_NAME(Projection)
  8. __attribute__((visibility ("default")))
  9. @interface MBMProjection : NSObject
  10. // This class provides custom init which should be called
  11. - (nonnull instancetype)init NS_UNAVAILABLE;
  12. // This class provides custom init which should be called
  13. + (nonnull instancetype)new NS_UNAVAILABLE;
  14. /**
  15. * Calculate distance spanned by one pixel at the specified latitude
  16. * and zoom level.
  17. *
  18. * @param latitude The latitude for which to return the value.
  19. * @param zoom The zoom level.
  20. *
  21. * @return Returns the distance measured in meters.
  22. */
  23. + (double)getMetersPerPixelAtLatitudeForLatitude:(double)latitude
  24. zoom:(double)zoom;
  25. /**
  26. * Calculate Spherical Mercator ProjectedMeters coordinates.
  27. *
  28. * @param coordinate A longitude-latitude pair for which to calculate
  29. * `projected meters` coordinates.
  30. *
  31. * @return Returns Spherical Mercator ProjectedMeters coordinates.
  32. */
  33. + (nonnull MBMProjectedMeters *)projectedMetersForCoordinateForCoordinate:(CLLocationCoordinate2D)coordinate __attribute((ns_returns_retained));
  34. /**
  35. * Calculate a longitude-latitude pair for a Spherical Mercator projected
  36. * meters.
  37. *
  38. * @param projectedMeters Spherical Mercator ProjectedMeters coordinates for
  39. * which to calculate a longitude-latitude pair.
  40. *
  41. * @return Returns a longitude-latitude pair.
  42. */
  43. + (CLLocationCoordinate2D)coordinateForProjectedMetersForProjectedMeters:(nonnull MBMProjectedMeters *)projectedMeters;
  44. /**
  45. * Calculate a point on the map in Mercator Projection for a given
  46. * coordinate at the specified zoom scale.
  47. *
  48. * @param coordinate The longitude-latitude pair for which to return the value.
  49. * @param zoomScale The current zoom factor (2 ^ Zoom level) applied on the map, is used to
  50. * calculate the world size as tileSize * zoomScale (i.e., 512 * 2 ^ Zoom level)
  51. * where tileSize is the width of a tile in pixels.
  52. *
  53. * @return Returns a point on the map in Mercator projection.
  54. */
  55. + (nonnull MBMMercatorCoordinate *)projectForCoordinate:(CLLocationCoordinate2D)coordinate
  56. zoomScale:(double)zoomScale __attribute((ns_returns_retained));
  57. /**
  58. * Calculate a coordinate for a given point on the map in Mercator Projection.
  59. *
  60. * @param coordinate Point on the map in Mercator projection.
  61. * @param zoomScale The current zoom factor applied on the map, is used to
  62. * calculate the world size as tileSize * zoomScale (i.e., 512 * 2 ^ Zoom level)
  63. * where tileSize is the width of a tile in pixels.
  64. *
  65. * @return Returns a coordinate.
  66. */
  67. + (CLLocationCoordinate2D)unprojectForCoordinate:(nonnull MBMMercatorCoordinate *)coordinate
  68. zoomScale:(double)zoomScale;
  69. @end