Switch branches/tags
Find file History
monsieurtanuki and spyhunter99 New projection systems: class TileSystem is now abstract and can be e…
…xtended (#1029)

* New projection systems: class TileSystem is now abstract and can be extended

New class:
* `TileSystemWebMercator`: the current implementation of a tile system in a Web Mercator projection

Impacted classes:
* `BookmarkSample`: now uses getters for min/max latitude/longitude
* `BoundBoxTest`: now uses getters for min/max latitude/longitude
* `BoundingBox`: now uses getters for min/max latitude/longitude
* `DomParserWms111`: now uses getters for min/max latitude/longitude
* `GeoPackageMapTileModuleProvider`: now uses getters for min/max latitude/longitude
* `GeoPointTest`: now uses getters for min/max latitude/longitude and other non static `TileSystem` methods
* `IconPlottingOverlay`: now uses getters for min/max latitude/longitude
* `LinearRing`: impacted the `getCenter` method
* `LinearRingTest`: now uses getters for min/max latitude/longitude
* `MapController`: now uses getters for min/max latitude/longitude
* `MapView`: created a `TileSystem` member with getter and setter, and a default `new TileSystemWebMercator()` value
* `MilStdPointPlottingOverlay`: now uses getters for min/max latitude/longitude
* `OpenStreetMapViewTest`: now uses getters for min/max latitude/longitude and other non static `TileSystem` methods
* `Overlay`: now uses getters for min/max latitude/longitude
* `PathProjection`: now uses non static `TileSystem` methods
* `Projection`: added a `TileSystem` in the constructor and as a member; now uses non static `TileSystem` methods
* `ProjectionTest`: impacted the new `TileSystem` parameter in the `Projection` constructor; now uses non static `TileSystem` methods
* `SampleAnimateTo`: now uses non static `TileSystem` methods
* `SampleAssetsOnlyRepetitionModes`: now uses getters for min/max latitude/longitude
* `SampleZoomToBounding`: now uses getters for min/max latitude/longitude and other non static `TileSystem` methods
* `microsoft.mappoint.TileSystem`: now uses non static `TileSystem` methods
* `org.osmdroid.util.TileSystem`: made it abstract, with 4 lat/lon to/from X01/Y01 methods and 4 min/max lat/lon getters; deprecated the min/max lat/lon members; removed the `static` keyword as much as possible in order to make the class extendable; renamed method `getX01FromLongitudeWithoutWrap` as `getX01FromLongitude` (same for `getY01FromLatitude`)
* `TileSystemTest`: now uses non static `TileSystem` methods of a `TileSystemWebMercator` instance

* Bug fix and new helper methods

Impacted classes:
* `BookmarkSample`: used the new `TileSystem.isValidLongitude/Latitude` methods
* `BoundingBox`: created a new default constructor without checks; used the new `TileSystem.isValid/Long/Lat/itude`, `TileSystem.toString/Long/Lat/itudeSpan` and `TileSystem.cleanLongitude` methods
* `MapController`: used the new `TileSystem.clean/Long/Lat/itude` methods; fixed a bug (calling `cleanLongitude` on a latitude); removed the private `cleanLongitude` method as we now use the `TileSystem` corresponding method
* `Projection`: used the new default `BoundingBox` constructor in order to avoid useless check crash
* `SampleZoomToBounding`: fixed a "360 vs. 2*maxlongitude" potential bug
* `SimpleFastPointOverlay`: used the new default `BoundingBox` constructor in order to avoid useless check crash
* `TileSystem`: created methods `cleanLongitude`, `cleanLatitude`, `isValidLongitude` and `isValidLatitude`; added some version comments

* MapView.getTileSystem() is now the TileSystem reference for the other classes

Main impacted class:
* `MapView`: member `mTileSystem` is now `static`

Impacted classes that now use `MapView.getTileSystem()` as `TileSystem` reference:
* `BoundingBox`
* `DomParserWms111`
* `GeoPackageMapTileModuleProvider`
* `LinearRing`
* `Overlay`
* `PathProjection`
* `SampleZoomToBounding`
Latest commit 8cae403 May 28, 2018