416 Commits

Author SHA1 Message Date
Emux
9de76897bc 0.9.2 2018-01-04 14:42:17 +02:00
Emux
a67b2f2c91 Gradle 4 / Android plugin 3 transitive dependencies, fix #433 2018-01-02 14:46:39 +02:00
Emux
791f054f70 libGDX 1.9.8, fix #464 2017-12-29 17:56:21 +02:00
Emux
7e13586463 Update changelog 2017-12-29 17:18:26 +02:00
Emux
c3639dcb24 Update Gretty 2017-12-29 17:18:10 +02:00
Emux
49ded685b4 0.9.1 2017-12-29 16:23:46 +02:00
Emux
9b14865bf3 Gradle 4 / Android plugin 3 improvements, #433 2017-12-29 15:59:59 +02:00
Izumi Kawashima
abac84e82a Add building z-limit function to shader and web ui (#462) 2017-12-26 13:59:42 +02:00
Emux
0367507dae Update changelog 2017-12-26 11:18:56 +02:00
ale5000
9977061680 LwHttp: fixed line break of HTTP headers (#461), fix #460 2017-12-26 11:08:15 +02:00
Emux
3cae38040c Update Android build tools 2017-12-23 15:00:26 +02:00
Gustl22
97cdfa119d Improve ExtrusionBuckets (#459)
+ Add method addPolyElement and addMeshElement
+ renamed setBuckets to resetBuckets
+ Add method getGroundScale to MapTile
2017-12-19 20:59:10 +02:00
Emux
641db3ade0 Merge pull request #458 from Gustl22/buckets
Refactor ExtrusionBucket
2017-12-19 14:09:30 +02:00
Gustl22
bddf2443b6 Refactor ExtrusionBucket
+ color and colors as private
+ renamed add(for meshes) to addMesh
+ renamed add(for polygons) to addPoly
2017-12-19 11:30:35 +01:00
Emux
1404d21838 BuildingLayer: make POST_AA public 2017-12-19 11:42:37 +02:00
Gustl22
95bbc5ea3e BuildingLayer: allow mesh in renderer, minor refactor (#457) 2017-12-19 11:41:43 +02:00
Emux
f8776ffe5f Merge pull request #456 from Gustl22/tags
Add needed osm-tags (S3DB)
2017-12-19 10:33:11 +02:00
Gustl22
bc1dee49a4 Fix double cloning issue of MapElement, use copy-constructor in GeometryBuffer and MapElement (#455) 2017-12-19 10:17:29 +02:00
Gustl22
d81a6309bf Add needed osm-tags (S3DB) 2017-12-19 08:57:56 +01:00
Emux
9a6da018a9 Samples: use OkHttp engine, fix #454 2017-12-12 11:11:29 +02:00
Emux
8d639499ba Fix Travis 2017-12-09 17:46:11 +02:00
Emux
a5d7a8f6b0 Update Mapsforge map providers 2017-12-08 21:26:37 +02:00
Emux
577f1520d2 Update Android build tools 2017-12-05 21:52:08 +02:00
Emux
c938533943 Update changelog 2017-12-04 21:37:55 +02:00
Gustl22
e3b137e3c4 GeometryBuffer: (#453)
+ renamed buffer positions
+ update docs
+ expand toString for meshes/tris
2017-12-04 21:17:30 +02:00
Emux
72b72b8029 Update documentation 2017-12-04 15:31:44 +02:00
Gustl22
ba68b79e86 Refactor S3DB layer (#452) 2017-12-04 15:08:19 +02:00
Emux
49ef4c8e1b 0.9.0 2017-12-03 17:06:59 +02:00
Gustl22
535482025e MapElement: enhance clone (not copy complete buffer) (#451) 2017-12-03 15:28:27 +02:00
Emux
e73ac4acfc Merge pull request #450 from andreynovikov/is-mapsforge-theme
Do not read theme twice if format is predefined
2017-11-27 11:47:38 +02:00
Andrey Novikov
bc20664bc5 Do not read theme twice if format is predefined 2017-11-27 10:22:48 +03:00
Emux
06936fc4ee Mapsforge maps v5 as Beta 2017-11-23 10:25:11 +02:00
Emux
0829098ebb Update Gradle Android plugin 2017-11-22 09:28:45 +02:00
Emux
8ad2036ec1 GeoPointUtils: calculate scale to display a BoundingBox #396 2017-11-20 10:48:16 +02:00
Emux
4f7675d2a8 Render themes: add building parts in all themes #41 2017-11-19 20:36:13 +02:00
Gustl22
8f4e9967f0 Buildings: handle references with id (OpenStreetMap, Mapzen) (#448) 2017-11-18 17:53:42 +02:00
Emux
f884c17195 Update contributing guide 2017-11-18 12:21:26 +02:00
lucaosten
490b932eab Code improvements (#446)
+ reduced memory usage of RenderBucket by making "type" byte instead of int
+ improved code readability in TextItem by renaming variable
+ added latitude/longitude validation methods to GeoPointUtils
+ solved Java double precision problem in GeoPoint
+ made GeoPoint Serializable for easier Android usage
+ made BoundingBox.toString() human readable for better debugging
2017-11-18 11:54:26 +02:00
Gustl22
149353119b Add OSM and S3DB tags (#447) 2017-11-17 20:00:51 +02:00
Emux
9c3f3b8a4c BitmapTileLayer: fix default bitmap alpha #444 2017-11-15 22:08:44 +02:00
Andrey Novikov
f9e06c80ad BitmapTileLayer: fade steps enhancements, support for permanent transparency (#444) 2017-11-14 16:51:56 +02:00
Gustl22
fe2c067272 TagSet: numTags and tag array as private (#439) 2017-11-13 12:24:54 +02:00
Longri
9c3488e107 iOS: add POT textures test (#443) 2017-11-12 12:03:47 +02:00
Longri
df784f6f68 Fix POT textures in render themes (#443) 2017-11-12 12:00:06 +02:00
Schedul Xor
a178357ca8 Added app to Applications.md (#442) 2017-11-11 22:48:35 +02:00
Emux
6627eab8e2 Update Android build tools 2017-11-10 11:31:26 +02:00
Andre Höpfner
0a7638e10d iOS: fix text drawing with stroke width (#441) 2017-11-10 10:38:08 +02:00
lucaosten
f94c665b27 fixed thread safety problem in Viewport (#438)
recycled variables were accessed non synchronized (and therefore non
thread safe) causing errors once multiple threads were used interacting
with the Viewport
2017-11-03 20:04:09 +02:00
Emux
d23bca9c7f Gradle 4 and Android plugin 3 improvements #433, fix #436 2017-10-30 12:28:03 +02:00
Emux
53dbb737fb Gradle 4 and Android plugin 3 improvements #433 2017-10-29 20:23:04 +02:00
Emux
1aa5f24e11 vtm-android-gdx module, fix #435 2017-10-29 18:53:24 +02:00
Emux
1d44057198 libGDX 1.9.7, fix #434 2017-10-29 18:53:13 +02:00
Emux
bcf4cff42b LWJGL 2 desktop exit status #433 2017-10-29 18:53:07 +02:00
Emux
cbdeb58c2f Gradle 4 and Android plugin 3, fix #433 2017-10-29 18:52:55 +02:00
Andrey Novikov
df5bcd583f Enable style categories (#430) 2017-10-24 13:20:18 +03:00
Emux
e2a4ad8a97 Marker clustering: allow custom cluster renderer #312 2017-10-21 19:35:07 +03:00
Emux
795359fb44 Update documentation 2017-10-17 20:12:36 +03:00
Emux
a9a042ea41 Mapsforge maps v5 support improvements #429 2017-10-17 13:15:30 +03:00
Gustl22
cd5a62a2ff Mapsforge maps v5 support (#429) 2017-10-17 11:00:45 +03:00
Andre Höpfner
dfd3a7dcf6 + update SVGgh to version 1.9.2 with iOS 11 compatibility (#426)
+ update RoboVM to version 2.3.2 with iOS  11 compatibility with InteliJ-PlugIn Version 2.3.3-SNAPSHOT and compatibility with Xcode 9.0
2017-10-12 14:54:33 +03:00
Emux
5615604170 Render themes improvements #41 2017-10-12 10:46:26 +03:00
Emux
b3f6899b1f Mapsforge themes: fix default position tag #100 2017-10-12 10:31:01 +03:00
Emux
e3f2f19119 PathLayer, VectorLayer (polygon) overlays touch events #316 #424 (#425) 2017-10-05 20:39:30 +03:00
Emux
126b98ae8c Render themes improvements #41 2017-10-05 20:00:59 +03:00
Emux
9104b746ac ItemizedLayer: use scaling in touch calculations 2017-10-05 15:41:53 +03:00
Emux
fc6bce20bb Update Travis 2017-10-05 13:51:47 +03:00
Emux
76582da497 Render themes: highway ref captions #41 2017-10-04 20:24:29 +03:00
Emux
a06ea5492e Two finger tap zoom out gesture, fix #423 2017-10-04 15:43:01 +03:00
Emux
1d7ece5a65 Render themes: "base-stroke-width", fix #422 2017-10-03 19:42:16 +03:00
Emux
67b911a7df Render themes: add ferries, fix #421 2017-10-03 14:47:39 +03:00
Emux
7947e5c027 Update changelog 2017-10-03 14:27:01 +03:00
Emux
69f7ed7ae0 Update changelog 2017-10-03 13:33:46 +03:00
Gustl22
fa658bd1f0 Support of extrusions in BuildingLayer on Mapzen maps (#419)
+ Tag add "levels"
+ BuildingLayer: support extrusions with height and levels, string unit in meters
+ Support height for Mapzen building_parts
+ Support of building parts in default theme and mapzen
2017-10-03 13:30:23 +03:00
Emux
233f0c4f7e Allow custom tile size instead of the calculated one 2017-09-29 19:37:39 +03:00
Emux
02b29c7584 Samples improvements #32 2017-09-28 21:01:34 +03:00
Emux
cedf3edc61 Render themes improvements #41 2017-09-28 15:05:41 +03:00
Emux
60aa9600d8 Render themes: rule types order, fix #418 2017-09-28 14:47:34 +03:00
Emux
3d92807d26 Render themes: Cap modes, fix #417 2017-09-28 13:00:10 +03:00
Emux
67195bbc0c Mapsforge themes: use tessellation, fix #415 2017-09-27 15:40:29 +03:00
Emux
7ba5984e5f Render themes: store theme origin, fix #414 2017-09-27 15:37:00 +03:00
Emux
27aee33cb9 Do not catch graphics exception too early, fix #413 2017-09-27 14:39:28 +03:00
Andrey Novikov
4a848cc08c Do not catch graphics exception too early (#413) 2017-09-27 14:39:15 +03:00
Emux
75c2841a13 Mapsforge themes 3D buildings, fix #411 2017-09-27 13:18:30 +03:00
Emux
ed8f03122b Update Android libs 2017-09-27 09:51:33 +03:00
Emux
d80e4fdabc Render themes: stroke dash array supports odd entries number #131 2017-09-26 21:35:05 +03:00
Emux
c8817f80c8 Render themes: line symbol improvements #124 2017-09-26 20:58:24 +03:00
Emux
3ee1034f1a Render themes: stroke dash array improvements #131 2017-09-26 20:57:17 +03:00
Emux
3b224d21fc Extrusions default height, fix #409 2017-09-26 19:13:58 +03:00
Emux
0d7d75ccb5 Mapsforge themes: convert "priority" to VTM, fix #408 2017-09-25 15:02:45 +03:00
Emux
324a1c309c Mapsforge themes don't support (-) 'exclusive negation', fix #407 2017-09-24 12:41:53 +03:00
Emux
0046f5c159 Render themes: line symbol, fix #124 2017-09-23 21:03:05 +03:00
Emux
7865867973 Render themes: stroke dash array improvements, fix #131 2017-09-23 18:07:42 +03:00
Emux
7c12c2ae9b Polygon symbol positioning, fix #405 2017-09-19 11:58:22 +03:00
Emux
564435a22a Render themes improvements #41 2017-09-18 09:42:14 +03:00
Emux
607cdeb5db Feature parameters, fix #403 2017-09-16 18:03:28 +03:00
Emux
4903a4b5f4 Update .gitignore 2017-09-16 17:37:59 +03:00
Emux
e5043447e3 PolyLabel samples #402 2017-09-16 17:14:10 +03:00
Emux
4f78fed094 PolyLabel default disabled #402 2017-09-15 21:28:05 +03:00
Emux
0fbce21140 Samples improvements #32 2017-09-15 19:23:36 +03:00
Emux
3a19c2f2f5 Render themes improvements #41 2017-09-14 13:18:56 +03:00
Emux
c694fbc63b VTM map scaling improvements, fix #401 2017-09-14 13:18:56 +03:00
Emux
c4b6d019ff Samples improvements #32 2017-09-14 13:18:56 +03:00
Emux
3603dfef03 ThemeLoader: fix text scaling #92 2017-09-14 09:32:49 +03:00
Emux
35f1e7092c CanvasAdapter: add user scale option #92 2017-09-13 16:32:07 +03:00
Emux
9283b80594 Automatic tile size calculation #92 2017-09-12 20:21:56 +03:00
Emux
f81dff2365 CanvasAdapter: add getScale method #92 2017-09-11 13:05:22 +03:00
Emux
5c2b404b3f Mapsforge Reverse Geocoding #383 (#398)
* Mapsforge Reverse Geocoding #383

* Mapsforge Reverse Geocoding example #383
2017-09-10 17:04:19 +03:00
Emux
095ed65eb3 Core utilities #396 (#397) 2017-09-10 15:59:54 +03:00
Emux
3d7a09c457 OSMIndoorLayer: fix polygon line color parsing #366 2017-09-09 15:56:11 +03:00
Emux
abc1867d7c Fix Point distance 2017-09-08 20:42:33 +03:00
Emux
3449bd86e8 Samples: POI Search example, close #394 2017-09-07 12:02:39 +03:00
Emux
1861ca4a1b Samples improvements #32 2017-09-07 10:32:50 +03:00
Emux
a77d89b8b3 vtm-theme-comparator: use Mapsforge snapshot version #387 2017-09-07 10:09:08 +03:00
Emux
f63c303293 Mapsforge: at large query zoom levels enlarge clip buffer, fixes #231 2017-09-06 11:34:51 +03:00
Emux
f1634e4976 Mapsforge: at large query zoom levels clip everything #231, fixes #391 2017-09-06 11:34:31 +03:00
Emux
b59f20ef49 Fix web modules 2017-09-05 15:45:08 +03:00
Emux
07138f3240 Mapsforge themes compatibility improvements #100, fix #392 2017-09-05 15:24:48 +03:00
Emux
eddfa5a896 vtm-theme-comparator: add 'fatjar' Gradle task #387 2017-09-05 12:30:02 +03:00
Emux
4532e397c0 vtm-theme-comparator: fix application exit #387 2017-09-05 12:29:57 +03:00
Emux
81a270428c Update changelog 2017-09-03 19:15:30 +03:00
Emux
76e73368ab Render themes: line symbol and stroke dash array #124 #131 2017-09-03 18:03:07 +03:00
Emux
f4f8eb8d1c Mapsforge themes compatibility improvements #388 #100 2017-09-03 18:02:55 +03:00
Longri
b695d43fee Mapsforge themes compatibility (#388) #100 2017-09-03 18:02:35 +03:00
Emux
f6d2db4c6f Enable vtm-jeo module #375 2017-08-29 19:48:22 +03:00
Emux
e1db67f099 JTS PathLayer: do not try to calculate zero length great circle path by @andreynovikov #390 2017-08-28 16:56:44 +03:00
Andrey Novikov
7142f3410d PathLayer: do not try to calculate zero length great circle path (#390) 2017-08-28 16:53:54 +03:00
Emux
b110314077 vtm-theme-comparator: use same tile size and synchronize zoom level #387 2017-08-22 19:17:57 +03:00
Emux
1cf4d3a60b vtm-theme-comparator improvements #387 2017-08-21 20:30:28 +03:00
Longri
9c5fd29ff1 vtm-theme-comparator module (#386) #387 2017-08-21 20:24:52 +03:00
Emux
27a39fbfd7 OpenMapTiles theme: enable ocean #385 2017-08-11 22:25:51 +03:00
Emux
d3aa2af73b OpenMapTiles GeoJSON vector tiles #385 2017-08-11 21:33:28 +03:00
Emux
2555fea5da UrlTileSource: customize api key name #49 2017-08-11 21:17:43 +03:00
Emux
8bb63c875f Use Google's Maven repository 2017-07-26 11:02:49 +03:00
Emux
76dcc8b909 Update Android 2017-07-25 09:43:39 +03:00
Wolfgang Schramm
c38975fcba Cluster marker is clipped, fixed by reducing radius (#382)
* fixed cluster marker is clipped by reducing radius

fixed comment, swaped fill <-> outline

* replaced static size with dpi dependent size
2017-07-24 19:16:55 +03:00
Wolfgang Schramm
b90d99f82b ClusterMarkerRenderer: repopulateCluster() is called with different scales (#381)
mScaleSaved is log2 smaller than scale.
This fixes the bug that subsequent calls to populate() will display the markers correctly and will not be clustered to one single cluster.
2017-07-23 18:06:11 +03:00
Andrey Novikov
76d55bb1a0 Do not fling if map move is disabled (#378) 2017-07-19 16:26:37 +03:00
Emux
d9f7638a25 Update changelog 2017-07-19 15:04:19 +03:00
Emux
e7a391e640 LineTexBucket: remove redundant u_scale uniform, fix #376 2017-07-19 15:02:01 +03:00
Andrey Novikov
12fe08884e Enable custom label loader in label layer (#377) 2017-07-19 14:46:25 +03:00
Emux
4d9ad3e942 0.8.0 2017-07-19 11:51:10 +03:00
Emux
ae6ce553b9 Disable vtm-jeo module until update #375 2017-07-19 10:45:37 +03:00
Emux
13c42d509c LabelLayer: improvements for prevent running worker when disabled #374 2017-07-12 10:03:17 +03:00
Wolfgang Schramm
a6aa2b2388 LabelLayer: prevent running worker when disabled (caused a loop) (#374) 2017-07-12 09:57:09 +03:00
Wolfgang Schramm
9f7fe2577b Add state parameter to all animateTo methods which called animStart with a hardcoded state. (#373)
Preserve old API which now calls the extended animateTo methods.
2017-07-08 18:36:03 +03:00
Emux
ad2348631a Update applications list 2017-07-06 19:49:26 +03:00
Emux
2dbad2b16a OkHttp sources and sinks are not threadsafe, fix #369 2017-07-03 12:18:49 +03:00
Emux
8db30d8537 Mapsforge: increase limit for max way length causing empty tiles, fix #370 2017-06-30 22:17:53 +03:00
Emux
25f0310334 Height offset in render styles, close #368 2017-06-24 20:05:34 +03:00
Emux
3041ab5515 GeoJSON tile decoder: fix variable typo #367 2017-06-22 19:58:16 +03:00
Emux
27e2c5dde5 Mapzen GeoJSON vector tiles with vtm-json module, close #55 #367 2017-06-21 14:49:54 +03:00
Emux
a386cfea4f Render theme improvements #41 2017-06-21 10:06:38 +03:00
Emux
fe104300ba Mapzen MVT: refactor tile source #57 2017-06-20 20:54:40 +03:00
Emux
f1ae5c3d68 Deprecate Mapnik GeoJSON sample #48 2017-06-20 20:26:22 +03:00
Emux
767019ee06 OSM indoor layer: allow setting text style #366 2017-06-20 09:24:09 +03:00
Emux
3a3a58d273 OSM indoor layer: allow setting inactive levels color, closes #366 2017-06-19 19:51:45 +03:00
Emux
0eb53403d1 Location renderer: improve scaling #317 2017-06-17 18:05:29 +03:00
akarsh
4938852b40 Update OSMIndoorLayer.java (#365)
The get level method does not parse levels with double type i.e. 0.5.
The app crashes at the time of loading. The solution to this issue, is
parsing double and then converting it into integer value.
e.g. level 0.5 to level 0
2017-06-17 14:31:21 +03:00
akarsh
0d14473132 Update OSMIndoorLayer.java (#364)
The getlevel method does not work for geojson files created without @relations tags.
Here is the example of two levels 1 & 2 file:f483daa278/bothlevels.geojson

Created using JOSM and following simple indoor tagging.
2017-06-16 09:19:39 +03:00
Emux
34ddf3a005 Update indoor Overpass sample 2017-06-15 20:28:41 +03:00
Emux
9ca4785701 Location renderer: fix external shaders initialization #317 2017-06-15 15:50:07 +03:00
Emux
8d2aba9c65 Location renderer: add scaling support #317 2017-06-15 12:31:23 +03:00
Emux
2872ce94a3 Location shaders: proper fix #321 2017-06-13 13:27:58 +03:00
Emux
d5ebf43e3d Location shaders: some Mali GPU don't like ternary operators #321 2017-06-13 12:03:12 +03:00
Emux
223eb120fa Location renderer: avoid continuous rendering, closes #141 2017-06-12 15:40:45 +03:00
Emux
b94d943247 Fix location shader #321 2017-06-11 19:41:52 +03:00
Emux
d409aa5b96 Location renderer custom color, closes #361 2017-06-11 19:12:59 +03:00
Emux
644c83ed69 Android 8.0 (O) 2017-06-09 20:24:38 +03:00
Emux
db871d4a22 OkHttpEngine improvements #138 2017-06-08 19:31:27 +03:00
Emux
3f959a3b46 OkHttpEngine: improve cache API, add example #138 2017-06-07 21:24:18 +03:00
Emux
903dbad9c6 Mapsforge: remove MapDatabase.readZoomTable redundant checks, fixes #357 2017-06-05 13:56:10 +03:00
Emux
3afca64080 OkHttpEngine: add timeout options #138 2017-06-04 22:41:27 +03:00
Emux
16f0d524c5 UrlTileDataSource: catch NPE input stream 2017-06-04 22:38:58 +03:00
Emux
f669022ca3 OSMIndoorLayer: add style scaling #355 2017-06-02 21:54:29 +03:00
Emux
dce7886447 OSMIndoorLayer: enable labels, fixes #355 2017-06-02 21:42:06 +03:00
Emux
f77c46f56d Render theme styles: allow setting menu callback #93 2017-06-01 14:53:11 +03:00
Emux
45383397bc Update dependencies 2017-05-30 14:11:44 +03:00
Emux
c14e93e25d Render themes: add highway ref tag #41 2017-05-28 21:35:36 +03:00
Emux
7b7b5a923a Update applications list 2017-05-24 20:39:25 +03:00
Mathieu De Brito
6b4bb7d8bf Added accessible static value as default building height (#351) 2017-05-22 20:28:11 +03:00
Emux
5d4d630ce0 Update Android Gradle plugin 2017-05-12 09:43:21 +03:00
Andre Höpfner
8d121c0798 Update RoboVM to 2.3.1 release (#350) 2017-05-10 12:23:24 +03:00
Emux
6b362e5125 Update applications list 2017-05-09 22:33:24 +03:00
Emux
c2eb679adf Improve canvas DPI setting, fixes #349 2017-05-09 15:32:06 +03:00
Emux
183cb8aafd Update Android build tools 2017-04-24 20:39:12 +03:00
Emux
4bf27bc910 GdxSpriteBatchTest: fix map position scale #337 2017-04-15 12:39:07 +03:00
Andre Höpfner
f0639972b4 make iOS 10.3 and Xcode 8.3 compatible (#345)
recompile SvgGh library with new code singature needed by iOS 10.3
2017-04-08 20:32:18 +03:00
Emux
e1d17321c6 Update applications list 2017-04-08 17:45:02 +03:00
Emux
b75ac0d647 Update Android Gradle plugin 2017-04-05 15:30:07 +03:00
Emux
7f81ddf47f Update changelog 2017-04-02 17:03:54 +03:00
Longri
c580e1d7a5 Map renderer COORD_SCALE configurable and global use (#344) 2017-04-02 16:26:03 +03:00
Emux
7a28788972 Fix applications list 2017-04-01 17:33:12 +03:00
Emux
36e547d828 Update applications list 2017-04-01 16:21:08 +03:00
Emux
bd762dae9e MapboxMapActivity: disable cache, add grid for debug #32 2017-03-31 16:12:33 +03:00
Emux
347c1d31bb Location renderer improvements #321 2017-03-29 13:28:04 +03:00
Emux
c6be08a903 Update Android support library 2017-03-28 19:32:23 +03:00
Emux
8ab2195500 Layer enabled state #342 improvements 2017-03-28 19:16:03 +03:00
Andre Höpfner
9fff945978 Handle layer enabled state (#342) 2017-03-28 19:13:35 +03:00
Emux
18d8e18bdf Android samples: fix scale bar check on exit #32 2017-03-22 21:34:52 +02:00
Emux
b32692942f Gretty plugin (Gradle) at web modules, closes #338 2017-03-18 19:20:43 +02:00
Emux
9c58d8219c GdxMap: make map renderer protected 2017-03-18 15:17:16 +02:00
Lóránt Viktor Gerber
32c57a42a4 vtm-playground: add SpriteBatch test (#337) 2017-03-18 15:13:50 +02:00
Emux
6c004b8be7 Update changelog 2017-03-18 14:10:53 +02:00
Emux
9a31cc07b5 Update Android support library 2017-03-17 19:19:27 +02:00
Emux
0de27b7354 Update applications list 2017-03-17 14:53:27 +02:00
Longri
dc340a382e vtm-ios: remove slf4j-simple dependency (#335) 2017-03-17 10:54:04 +02:00
Emux
4c9354c326 POT textures #334 improvements and samples 2017-03-16 14:48:06 +02:00
Longri
d1fdca170e POT textures (#334) 2017-03-16 14:15:39 +02:00
Emux
d614809df0 Update integration guide 2017-03-16 10:07:41 +02:00
Emux
0c3acfd69c Update integration guide 2017-03-15 19:59:53 +02:00
Emux
da95660c73 libGDX 1.9.6, closes #333 2017-03-15 14:13:12 +02:00
Emux
c8396062ae Integration guide: add Android (with libGDX) 2017-03-15 13:08:19 +02:00
Longri
579f49bfd6 IosBitmap.recycle() crash (#332) 2017-03-13 09:37:22 +02:00
Emux
20f1121d3a Location renderer improvements #321 2017-03-09 13:54:32 +02:00
Emux
26253a6104 Update integration guide 2017-03-08 16:26:42 +02:00
Emux
b190211e5a Android MapView in layout designer, closes #330 2017-03-08 13:17:35 +02:00
Emux
edf29d2b0e Update integration guide 2017-03-08 12:43:54 +02:00
Longri
a001f4615c iOS: remove unused Gradle settings (#329) 2017-03-07 14:51:31 +02:00
Emux
5818edc228 Graphics API #328 improvements 2017-03-07 14:41:02 +02:00
Longri
e562ebdff6 AwtCanvas draw bitmap pixel perfect (#328) 2017-03-07 14:04:16 +02:00
Emux
d08ef59278 Update readme 2017-03-07 11:40:47 +02:00
Emux
bb1d602267 Samples improvements #32 2017-03-07 11:11:31 +02:00
Emux
c1eca04ab1 Samples improvements #32 2017-03-07 11:00:49 +02:00
Emux
f6c28dc158 Update changelog and readme 2017-03-06 21:18:16 +02:00
Emux
b760eadd4d vtm-ios-example Gradle cleanup 2017-03-06 20:45:57 +02:00
Longri
7500ca1711 vtm-ios-example module (#326) 2017-03-06 20:44:38 +02:00
Emux
808671c1fb Theme texture atlas #324 improvements, #63 2017-03-06 19:53:18 +02:00
Longri
2d3ab0b6fd Theme texture atlas at runtime (#324), #63 2017-03-06 16:56:56 +02:00
Emux
6461d39357 Location renderer improvements #321 2017-03-05 19:15:59 +02:00
Emux
e0c02a83d0 Atlas multi-texture sample improvements #319 2017-03-05 16:54:07 +02:00
Longri
ca56e0fe33 BitmapPacker wrong Texture on iOS (#323), fixes #322 2017-03-05 16:28:40 +02:00
Emux
320ce5b44d Location shaders: check no rotation, fixes #321 2017-03-05 12:09:53 +02:00
Emux
f061e06d94 Location renderer: allow external shaders, move existing to glsl files, closes #317 2017-03-04 19:30:19 +02:00
Emux
d1ce52ef52 Graphics API: enable paint text alignment, closes #320 2017-03-04 18:35:10 +02:00
Emux
28961caa79 Marker clustering improvements #312 2017-03-04 18:32:13 +02:00
rodo
4b30ca3242 Marker clustering (#296) (#310) #312 2017-03-04 18:06:28 +02:00
Emux
84c45e153a Update changelog 2017-03-04 16:24:30 +02:00
Mathieu De Brito
d8001e23f6 LocationRenderer: add reverse version of shader 1 (#318) 2017-03-03 20:35:20 +02:00
Emux
559f4899dd Update Mapsforge maps 2017-03-03 13:25:39 +02:00
Emux
04f02d9ae5 Gradle 3.3, Android Gradle plugin 2.3.0, Android Maven plugin 1.5 2017-03-03 13:16:17 +02:00
Emux
acb7727234 Samples: use vector map #32 2017-03-02 21:00:22 +02:00
Emux
ac0455b1b4 Atlas multi-texture Android example #301 2017-03-02 20:13:38 +02:00
Longri
5480cd6df8 Allow multiple TextureAtlas per SymbolBucket (#303) 2017-03-02 20:12:26 +02:00
Longri
325f848969 iOS: canvas drawCircle implementation (#309) 2017-03-02 15:57:43 +02:00
Emux
ea402f77f1 Canvas fillColor: use common defaults, closes #314 2017-03-02 15:07:41 +02:00
Emux
759915861e Mapsforge sample: add scale bar #32 2017-03-02 15:07:41 +02:00
Emux
bc46217449 Android samples: use proper inheritance, fixes #311 2017-03-01 20:50:23 +02:00
Emux
d8030c1364 Update changelog 2017-03-01 13:09:40 +02:00
Longri
23d34fa00a Texture atlas: use bitmap packer based on libGdx PixmapPacker (#304) 2017-03-01 12:59:38 +02:00
Emux
29322acf87 Graphics API: draw line using floats 2017-02-28 20:58:13 +02:00
Emux
5dcffcc537 Graphics API: draw circle Desktop implementation 2017-02-28 20:43:44 +02:00
rodo
67afa0b7ab Graphics API: draw circle (#295) 2017-02-28 20:30:21 +02:00
Emux
a6ecab334c OkHttp external cache improvements, closes #135 2017-02-28 15:24:54 +02:00
Mathieu De Brito
edf89ce36b Made OKHttpEngine compliant with TileCache (#299) #135 2017-02-28 15:01:49 +02:00
Emux
4f687e6fec Mapzen theme: add regions #57 2017-02-28 14:25:34 +02:00
Robin
cfc036c7ec Mapzen theme: show neighbourhoods (#308) #57 2017-02-28 13:20:32 +02:00
Emux
3dbc44e9c2 Use Osmagray theme in samples #300 2017-02-27 21:39:56 +02:00
rodo
c9e1c81cca New Osmagray theme (#306), closes #300
- Based on OSMARENDER, just translated all colors to their grayscale equivalent
- Does not include textures, the few textures like parks will show up in color
- ... but 95% of the style is grayscale
2017-02-27 21:35:56 +02:00
Emux
f7e5544238 Symbol rotation #294 improvements 2017-02-27 20:37:54 +02:00
Longri
981536595f Symbol rotation (#294) 2017-02-27 20:14:36 +02:00
Emux
5aaa2ca96b Update changelog 2017-02-27 18:39:48 +02:00
Izumi Kawashima
b7a3844aac WebGL: skip GL_VERTEX_PROGRAM_POINT_SIZE for GL points (#305) 2017-02-27 17:28:06 +02:00
Emux
b3e2385ba5 0.7.0 2017-02-26 14:25:08 +02:00
Emux
03821e1f51 Make Travis happy 2017-02-22 12:42:05 +02:00
Emux
77dc06d650 Update Android support library 2017-02-22 11:39:12 +02:00
Emux
0cd6c48b16 Update JTS 2017-02-22 11:38:55 +02:00
Emux
8a595fd37f 0.7.0-rc2 2017-02-20 11:15:12 +02:00
Emux
967875d6b8 XmlThemeBuilder: use English case transformation rules, fixes #297 2017-02-19 22:10:17 +02:00
Emux
d60e2ef575 0.7.0-rc1 2017-02-16 14:53:42 +02:00
Emux
58ecf60d9d vtm-web: fix javadoc 2017-02-16 11:45:04 +02:00
Emux
17356e5a2b vtm-web: add in Maven deploy 2017-02-16 10:52:08 +02:00
Emux
296fdd3c13 Update Mapsforge-Maps.md 2017-02-14 10:27:07 +02:00
Emux
735acc520a Android MapView: add onDestroy method 2017-02-13 10:14:53 +02:00
Emux
ac115b1f0f TileSource: add name parameter 2017-02-12 21:09:38 +02:00
Emux
d2ba6647ea OkHttp: catch exceptions #138 2017-02-11 23:30:08 +02:00
Emux
0180c40855 Mapbox (Mapzen): use OkHttp engine #57 2017-02-11 22:33:35 +02:00
Emux
817bd13d7b OkHttp 3 engine, closes #138 2017-02-11 22:33:23 +02:00
Emux
d22dc79655 Fix readme 2017-02-07 12:48:51 +02:00
Emux
fc9ef062c0 Update readme 2017-02-07 12:37:19 +02:00
Emux
f2dda7c8eb vtm-web-app: include theme with texture atlas symbols #51 2017-02-06 20:07:55 +02:00
Emux
fdc793d9ec Samples: fix location layer visibility #32 2017-02-06 14:18:43 +02:00
Emux
3d24aade21 Samples: skip z-order in fragment #32 2017-02-06 14:17:47 +02:00
Emux
6d93aaf57f Update vtm-web-js build 2017-02-06 10:57:27 +02:00
Schedul Xor
8fc354c96a libGDX1.9.5, GWT2.8.0 applied to vtm-web (#290) 2017-02-06 10:48:19 +02:00
Emux
e30f3f7cc3 Update integration guide 2017-02-01 10:29:13 +02:00
Emux
aff2c77267 Update Android support library 2017-01-31 10:03:55 +02:00
Emux
33365b3f7d Mapbox (Mapzen) theme: cities improvements #287 #57 2017-01-29 11:43:06 +02:00
Robin
33fdc938fa Render capital cities early (#287)
Mapbox (Mapzen): Render capital cities early
2017-01-29 11:15:55 +02:00
Emux
8397d5a3be Platform identification improvements #286, closes #285 2017-01-27 20:09:33 +02:00
Longri
980e9d5e54 Add platform identification (#286) 2017-01-27 20:02:17 +02:00
Emux
bc7c55b1f8 Update readme 2017-01-27 12:01:55 +02:00
Longri
120182ec15 Texture atlas with marker overlays example (#284) 2017-01-27 11:58:27 +02:00
Emux
945b84f04f Update changelog 2017-01-26 20:54:48 +02:00
Andre Höpfner
f67c457006 Create TextureAtlas with TextureRegions from bitmaps (#283) 2017-01-26 20:53:40 +02:00
Emux
a2852b0761 Update integration guide 2017-01-22 16:38:08 +02:00
Emux
ebf5d408bc Add Mapsforge map providers list doc 2017-01-21 15:19:33 +02:00
Longri
75719eae29 iOS: improve upload texture for IosBitmap (#282) 2017-01-21 14:30:12 +02:00
Emux
5c825ea9eb Mapbox (Mapzen): locale improvements #57 2016-12-29 18:16:27 +02:00
Emux
15bc23cadf Mapbox (Mapzen): locale option #57 2016-12-29 17:56:23 +02:00
Emux
88f3283878 Render themes improvements #41 2016-12-29 17:17:48 +02:00
Emux
80848f9d2d Mapbox (Mapzen) vector tiles improvements #57 2016-12-29 16:40:49 +02:00
boldtrn
f1f5726457 Mapbox (Mapzen) vector tiles (#279), #57, fixes #271 2016-12-29 14:43:38 +02:00
Emux
2ccf3e4c64 Map limit via bounding box, closes #277 2016-12-27 12:39:31 +02:00
Emux
c8cbf8e0ce Oneway arrows in themes, closes #275 2016-12-24 16:07:43 +02:00
Emux
6544cc1081 Update changelog 2016-12-22 16:11:34 +02:00
Emux
4c72831336 Update applications list 2016-12-22 16:11:24 +02:00
Emux
06ac5142f7 Render theme callback, closes #274 2016-12-20 21:55:53 +02:00
Emux
feae45f78b Update libGDX to 1.9.5 #270 2016-12-14 15:33:26 +02:00
Emux
61b8233b97 Circles (GL points) stroke #268 2016-12-14 13:01:11 +02:00
Emux
7acbea88cc Update Android support library 2016-12-14 09:48:04 +02:00
Emux
19109516ae Circles (GL points) anti-aliasing #268 2016-12-13 19:56:44 +02:00
Emux
c1a5ad7e74 Update Android build tools 2016-12-13 09:38:24 +02:00
Emux
1a93e4ae13 TextStyle improvements 2016-12-12 12:22:15 +02:00
Emux
1de6ca8fb7 Render styles improvements 2016-12-11 15:17:42 +02:00
Emux
02db7ca08d ExtrusionStyle: add StyleBuilder interface 2016-12-11 11:42:48 +02:00
Emux
e9bb7aaae4 Render buckets improvements 2016-12-09 20:36:48 +02:00
Emux
989e9c2ae8 Update readme 2016-12-09 20:00:05 +02:00
Emux
e8f41cd339 Update applications list 2016-12-09 19:43:23 +02:00
Emux
eabd90d14c Applications list: update an app's license 2016-12-09 10:48:56 +02:00
Emux
3e4aad4d51 LocationLayer: move lazy enable to application #171 2016-12-08 20:26:50 +02:00
Emux
b6dc72bbb6 Circle map style: use GL quads or GL points #122 2016-12-08 14:30:05 +02:00
Emux
4cd11462da SVG resources scaling, closes #214 2016-12-08 12:06:14 +02:00
Emux
6344542b10 SymbolStyle: add style builder #214 2016-12-07 20:16:11 +02:00
Emux
e0031ae8aa CircleStyle fix #122 2016-12-07 15:57:36 +02:00
Emux
229ea0b350 CircleStyle: add style builder #122 2016-12-07 15:12:50 +02:00
Emux
0a5d08a908 Update Gradle Android plugin 2016-12-07 09:40:11 +02:00
Emux
aed54c9a49 Update changelog 2016-12-06 21:38:49 +02:00
Emux
1a3bf4e4fe Render theme improvements #41 2016-12-06 21:16:38 +02:00
Emux
591ae03667 GL shader version, closes #265 2016-12-06 21:07:53 +02:00
Emux
3a191fb513 Circle map style #122 2016-12-06 21:07:53 +02:00
Andrey Novikov
2821d8ddb8 Circle map style rendering (#202) #122 2016-12-04 11:26:12 +02:00
Emux
71d7b71035 Map.getMapPosition at animation end option 2016-12-02 19:25:36 +02:00
Emux
85858911fa MapPosition animation sample with queue 2016-12-02 13:04:02 +02:00
Emux
0a92c84668 GDX double tap zoom, closes #263 2016-12-02 10:48:55 +02:00
Emux
c21d7b4390 Android example for render theme styles #93, closes #255 2016-12-01 21:08:12 +02:00
Emux
38a9c71bc2 MapPosition animation sample improvements #252 2016-12-01 19:59:43 +02:00
Mathieu De Brito
2573e458d5 Add sample showing MapPosition animations not merge (#252) 2016-12-01 19:57:13 +02:00
Emux
25a9891133 Samples reorganization #32 2016-11-28 21:10:07 +02:00
Andrey Novikov
8ee4e5fb8c OSMUtils: Treat amenity as area in heuristic (#262) 2016-11-28 20:14:33 +02:00
Emux
a38b054228 OSMUtils: include correct copyrights #35 2016-11-28 20:03:12 +02:00
Andrey Novikov
d9bf94da99 Fix zoom animation not executed sometimes (#261) 2016-11-28 15:42:44 +02:00
Longri
77653096f9 Add events for scale / rotate / tilt by user (#256) 2016-11-28 15:02:06 +02:00
Andrey Novikov
5f534656ea Improved gestures: use VTM Task for asynchronous calls (#260) #253 2016-11-28 14:41:32 +02:00
Emux
ba93445259 Improved gestures: parallel system and samples #253 2016-11-28 14:41:32 +02:00
Andrey Novikov
71f7c45b21 Improved gestures (#249) #253 2016-11-28 14:28:44 +02:00
Emux
ca5e34e1fb Render themes new SVG resources, closes #251 2016-11-27 17:06:55 +02:00
Emux
d937f3516c Samples: add map events in desktop marker example #32 2016-11-25 09:50:18 +02:00
Emux
a8909fca08 GDX: improve keyboard shortcuts 2016-11-24 16:20:30 +02:00
Emux
b39feae045 Samples cleanup 2016-11-24 10:37:27 +02:00
Emux
9f4ef47b95 Gradle: enhance clean tasks in vtm web apps 2016-11-24 10:19:35 +02:00
Emux
25e79bac55 Update Android build tools 2016-11-23 09:41:05 +02:00
Emux
311f4c7929 Samples: map events improvements #32 2016-11-22 21:07:28 +02:00
Emux
557e1858a7 Android: fix quick scale vs long press, fixes #250 2016-11-22 20:39:47 +02:00
Emux
16fa42d462 Marker examples: add (map) long press events #32 2016-11-22 20:37:05 +02:00
Emux
1133edb83d vtm-app: fix location layer 2016-11-22 12:55:52 +02:00
Izumi Kawashima
f6dbeba3d8 Check and clamp bearing range each time it's set (#248) 2016-11-21 20:01:34 +02:00
Emux
bf8f0745a6 Fix Travis build 2016-11-21 12:59:07 +02:00
Emux
829e45224f Animator easing: improvements and backwards API compatibility (#242) #246 2016-11-21 12:42:48 +02:00
Schedul Xor
acde5d565d Added easing functions which currently works with Animator (#242) 2016-11-21 12:38:01 +02:00
Emux
f0a652faf3 vtm-web modules: minor cleanup #51 2016-11-21 11:20:31 +02:00
Schedul Xor
41867344e2 Support TextureRegion to be used for MarkerSymbol (#245) 2016-11-21 10:49:04 +02:00
Izumi Kawashima
0c39ff8be0 Made {X},{Y},{Z} customizable in derived tile sources for tile URL (#244) 2016-11-21 10:25:43 +02:00
Emux
6f78f08a04 vtm-web: update documentation 2016-11-20 19:40:44 +02:00
Emux
3388e1401f Improve code / xml formatting #54 2016-11-20 19:26:38 +02:00
Izumi Kawashima
308497ffa6 Update vtm-web modules (#240) #51 2016-11-20 19:13:00 +02:00
Izumi Kawashima
bfa5a095f0 UrlTileSource: use StringBuilder instead of String concatenation (#241) 2016-11-20 19:03:57 +02:00
Emux
96be36edb8 Update badges 2016-11-19 17:28:31 +02:00
Emux
7c9c3732fb Osmarender theme: fix 'scrub' overlap without tessellation '#41 2016-11-16 21:08:01 +02:00
Emux
add62c9fe8 Location layer: lazy rendering start for performance #171 2016-11-16 14:18:14 +02:00
Emux
4aaa1ce620 AwtPaint: fix getColor 2016-11-16 10:57:13 +02:00
Emux
aa63b49e5a Render themes improvements #41 2016-11-16 10:04:19 +02:00
Emux
1f1d91202c Update Android support lib 2016-11-15 09:26:03 +02:00
Emux
51eae28926 MapDatabase: use TileClipper buffer based on dpi, #231 2016-11-13 17:19:13 +02:00
Emux
58b5f2741b Use baseline 160dpi in scaling, closes #236 2016-11-13 16:52:29 +02:00
Emux
d82faad435 Render themes improvements #41 2016-11-13 16:52:29 +02:00
Emux
fc8223bfc8 Tile grid enhance color #238 2016-11-13 16:52:22 +02:00
Emux
3584c4be1e Tile grid layer scaling, closes #238 2016-11-13 11:45:44 +02:00
Emux
001dbe8447 House numbers (nodes) mix with symbols, fixes #234 2016-11-12 16:19:29 +02:00
Emux
54feb7a25e MapDatabase: clear tags with each element read, #234, fixes #235 2016-11-12 16:17:39 +02:00
Emux
ea2a94f76b Update changelog 2016-11-10 21:58:35 +02:00
Emux
b6bfbc612a Render themes improvements #41 2016-11-10 21:25:17 +02:00
Emux
1d545fd804 Mapbox vector tiles: use tessellation in water #57 2016-11-10 15:09:31 +02:00
Emux
3acf77c102 Render themes improvements #41 2016-11-10 14:22:59 +02:00
Emux
6dfe2df2fb Update Travis 2016-11-09 13:00:12 +02:00
Mathieu De Brito
6cb40e1c15 Android samples: add fragment example (#233) 2016-11-09 13:00:02 +02:00
Emux
afd03809e8 Render theme styles sample improvements #93 2016-11-09 11:44:45 +02:00
Emux
efa3cb0231 Render theme styles sample #93 2016-11-08 12:16:02 +02:00
Emux
a709bd2623 MapDatabase: use TileClipper buffer as half the tile size, #231 2016-11-07 21:53:53 +02:00
Emux
439f2b20ff Fix house numbers (nodes) visibility (with new maps), fixes #168 2016-11-05 17:49:28 +02:00
Emux
877d217f31 Update dependencies 2016-11-05 13:53:05 +02:00
Emux
885264ad8c Gradle: declare compile time only dependencies with Java plugin #229 2016-11-04 22:06:32 +02:00
Emux
e224a7cf5b Samples: minor improvements #32 2016-11-02 14:06:36 +02:00
Emux
e10a223ea6 Mapsforge: multiple map files with zoom levels, #208 2016-11-02 13:54:31 +02:00
Emux
f85453e60c Render themes: use tessellation in sea #208 2016-11-02 10:40:25 +02:00
Emux
a6b3d7b0c2 Mapsforge: multiple map files, closes #208 2016-11-02 10:32:30 +02:00
Emux
dc15ba5f34 Update documentation 2016-11-02 10:02:34 +02:00
pedrop
1d7afaf8de ItemizedLayer: API enhancements for adding Collection of any MarkerInterface implementation (#211) 2016-10-31 20:29:22 +02:00
pedrop
422d81d665 PathLayer: API enhancements for adding Collection of any GeoPoint extension (#211) 2016-10-31 19:58:13 +02:00
Emux
4b55043dcc MercatorProjection.latitudeToY not work at > ±85.05113°, fixes #222 2016-10-31 15:13:31 +02:00
Emux
7885529fff Update changelog #108 2016-10-30 17:43:02 +02:00
Emux
2c610f5e0b PathLayer: draw line improvements by @Bezzu, fixes #108 2016-10-30 17:31:22 +02:00
Emux
64a586dde8 MapFileTileSource: zoom level improvements, closes #219 2016-10-30 16:14:54 +02:00
Emux
c1f65144df Mapbox tile source: use new Mapzen production url #57 2016-10-29 22:12:56 +03:00
Emux
ad2ee3f40e Mapzem .mvt theme: update with SVG and various improvements #57 2016-10-29 21:46:16 +03:00
Emux
01365686fa Fix render theme schema 'src' regular expression 2016-10-29 21:18:22 +03:00
Emux
dece13ddc9 Mapbox vector tiles improvements and example #57 2016-10-29 20:56:01 +03:00
Emux
05e9e0cdc8 Mapbox vector tiles by @hjanetzek #57 2016-10-29 18:53:52 +03:00
Emux
a9283dd408 Render theme improvements #41 2016-10-28 20:43:16 +03:00
Emux
53ca77d18a Update changelog 2016-10-28 17:39:11 +03:00
Andrey Novikov
97654f0670 Polygon label position (#204), #80
- Fix infinite recursion on invalid polygons
- Allow setting area-size for text styles
- Skip unnecessary calculations if label is outside of visible area
2016-10-28 17:36:10 +03:00
Emux
cbd0ac01df Polygon label position (minor improvements) (#204), #80 2016-10-28 17:35:50 +03:00
Andrey Novikov
ca841f5181 Polygon label position enhancements (#204), closes #80 2016-10-28 17:34:53 +03:00
Emux
a322768f8a 0.6.0 2016-10-28 12:26:13 +03:00
Emux
fc7bb2df9b 0.6.0-rc3 2016-10-22 13:22:34 +03:00
Emux
062bb8d573 Update Android and Gradle plugin versions 2016-10-21 20:08:17 +03:00
szantai78
ccdea3b663 LocationRenderer: revert shader precision from high to medium #209, fixes #207 2016-10-21 19:18:19 +03:00
870 changed files with 30847 additions and 8077 deletions

View File

@@ -6,7 +6,7 @@ Before you start working on an unresolved issue or try to implement a new featur
You may also create a new issue on [Github](https://github.com/mapsforge/vtm/issues) or comment on an existing one to describe your ideas. We will then discuss the best way to realize your proposal and figure out how we can help you to get started quickly.
If you are only requesting a small change in the code, you may attach a patch file to the corresponding issue, but it is best to create a pull request on Github. Make sure that your patch is derived from the latest version in our **master** repository, otherwise we might be unable to apply it. Please follow our code and style conventions.
If you are only requesting a small change in the code, you may attach a patch file to the corresponding issue, but it is best to create a pull request on Github. Make sure that your patch is derived from the latest version in our **master** repository, otherwise we might be unable to apply it. Important is to keep pull requests simple with one feature in each. Please follow our code and style conventions.
Also please keep the pull request commits squashed, in order to avoid the clutter in repository and have only the finally changed files together. One way is described [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).

2
.gitignore vendored
View File

@@ -11,8 +11,10 @@ robovm-build
/vtm-web/war/
/vtm-web/assets/
/vtm-web/gwt-unitCache
/vtm-web-app/war/WEB-INF/
/vtm-web-app/assets/
/vtm-web-app/src/main/webapp/
/vtm-web-js/war/WEB-INF/
/vtm-web-js/assets/
/vtm-web-js/src/main/webapp/
/vtm-spatialite/

View File

@@ -1,22 +1,32 @@
sudo: false
language: android
jdk:
- oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-24.0.3
- android-24
- extra-android-m2repository
- oraclejdk8
env:
global:
- GRADLE_OPTS="-Xmx2048m"
- secure: sW674wuFZOuoX7jHQHDbX3j8NxL8JxR07cyq+CrrqJ537dU9lxWQmMBRUpOb+p/q7sQ74PUtiKJkmFgKCSJSAKY+nr6GJ8P/q6u5TUKbmUWODSn8znehX2zualfvFwpF4PILok/wUzXBQE62jn4lUua7cMdsHRMNHbLmKqBoVL0meObDDjsaJ/RCbOPuruy3FmgvXPp0+Y4zl1GsklDSyjFzg4LBzjAk9Ryvh1O4zvJBkkyfCgurLKCnOKIPy3v5fPMS9oDfO1aarAVGoZZe416pvTW4hb8cdB6kn9XWYDob4NDFX/sP5k7XIhd/NAIn9LrKFg0sLtATaKLX+BcasF1CgDR/u6+SEeQd5QaRF7Go2Nq5Ltuu4OIFONI2qhEeVDDK6Otf2WSWj9KPno2GHuumBfbg4ypWoJgmZrMXk8JeVV/OP/0jIQz3p/7yfF21X1XBEqYaVHPAMKdEYYkCSa46KfACyOt6LfnkuCHtoTOpFo7sq0omIA2HOtpIx1u3vMBUyAbQqT6cokkKB1b6gNTFwhHc+8ybfLFPljJB8cWshI+V/b06S6fekRmvTNxvDykWNsdlkENBYqc9hMfjcT4hO4K+76SWN62mimQYODvFyfTVMC7WkQ3k/XEnmqUPV5XkbaILbS1d/tA57N148FiJ5/QXtI6Y94imubYyVqU=
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
- ANDROID=27
- ANDROID_BUILD_TOOLS=27.0.3
- GRADLE_OPTS="-Xmx2048m"
- secure: sW674wuFZOuoX7jHQHDbX3j8NxL8JxR07cyq+CrrqJ537dU9lxWQmMBRUpOb+p/q7sQ74PUtiKJkmFgKCSJSAKY+nr6GJ8P/q6u5TUKbmUWODSn8znehX2zualfvFwpF4PILok/wUzXBQE62jn4lUua7cMdsHRMNHbLmKqBoVL0meObDDjsaJ/RCbOPuruy3FmgvXPp0+Y4zl1GsklDSyjFzg4LBzjAk9Ryvh1O4zvJBkkyfCgurLKCnOKIPy3v5fPMS9oDfO1aarAVGoZZe416pvTW4hb8cdB6kn9XWYDob4NDFX/sP5k7XIhd/NAIn9LrKFg0sLtATaKLX+BcasF1CgDR/u6+SEeQd5QaRF7Go2Nq5Ltuu4OIFONI2qhEeVDDK6Otf2WSWj9KPno2GHuumBfbg4ypWoJgmZrMXk8JeVV/OP/0jIQz3p/7yfF21X1XBEqYaVHPAMKdEYYkCSa46KfACyOt6LfnkuCHtoTOpFo7sq0omIA2HOtpIx1u3vMBUyAbQqT6cokkKB1b6gNTFwhHc+8ybfLFPljJB8cWshI+V/b06S6fekRmvTNxvDykWNsdlkENBYqc9hMfjcT4hO4K+76SWN62mimQYODvFyfTVMC7WkQ3k/XEnmqUPV5XkbaILbS1d/tA57N148FiJ5/QXtI6Y94imubYyVqU=
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
android:
components:
- tools
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID
before_install:
- yes | sdkmanager "platforms;android-$ANDROID"
script:
- ./gradlew clean build
- ./gradlew clean build
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
fi
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
fi
notifications:
email:
recipients:
- secure: fOInp4SGBqiIMgnsGceQTa0SuFLaAoxAF15W0crhuljGlqSgnbnBjh0xFEF4P5+q3VT3DgDZs53GVVo6S9gEl8AWJy84KGuUX1M/CQKUQC4bwNXJdHfY3MIy6D50da6UfwWeNS4ienKh2Rj6w2TapN9M8C9nJJZk9aJFc9NWZmWTVboHZd4oUDeeRBJ6KSk1Ay7L/mmxv4cMCXaW7pPJixvUFESKNYgK4KAN3zYpym2UijrQ8zf7OVcYnTorcAuXUZDk8EvwdHl3rIAdlbVqvyZ8rmoQ2Da/Q2VlWUL/HrHUVJtCPZ+T+dNUag4a8joIDqWKwcyk76PElmgft3azb7GERb+bkZz1ToQc2IvuOeUk2SsuXWZugoEQImKWl/yWeirWBLrwzieaVh4j04dMSn/Npc1yL5kjX9EuiM6MFHdYPianMpvhFiaYKihjzW0GPV6sfuY7xS8cA9L9DjAsXoHIXIxc/+hRA+bpPUl+qMaQdGjJmNJJ2VPFnOY0XCsDDQDIVa3nZOA6aXMUG2c4H26RJZPe7uvfRiuL86n3KAmkoXSwne9t8WYMgl89LMsU5XxjBvwz2Qa1HqG09tVs6nhB23easrhEYEf/ZsGg0DIIL1FImUHj+wUUfZXeyFmbiE6lD/i2+3a5DqzZGHbXUDCoUIagObMf8fe2z5+0K/Q=
on_success: always
on_failure: always

View File

@@ -1,60 +1,74 @@
[![Maven Central](https://img.shields.io/maven-central/v/org.mapsforge/vtm.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22)
[![Build Status](https://travis-ci.org/mapsforge/vtm.svg?branch=master)](https://travis-ci.org/mapsforge/vtm)
[![GitHub license](https://img.shields.io/badge/license-LGPL3-blue.svg)](COPYING.LESSER)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.mapsforge/vtm/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mapsforge/vtm)
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](http://www.gnu.org/licenses/lgpl-3.0)
# V™
VTM was developed within the [OpenScienceMap](http://opensciencemap.org) project.
VTM was developed within the [OpenScienceMap](https://github.com/opensciencemap) project.
**This fork continues VTM development. And provides compatibility with latest [Mapsforge](https://github.com/mapsforge/mapsforge).**
If you have any questions or problems, don't hesitate to ask our public [mailing list](https://groups.google.com/group/mapsforge-dev) for help.
See the **[integration guide](docs/Integration.md)** and [changelog](docs/Changelog.md). And read through [how to contribute](.github/CONTRIBUTING.md) guidelines.
See the [integration guide](docs/Integration.md) and [changelog](docs/Changelog.md). And read through [how to contribute](.github/CONTRIBUTING.md) guidelines.
If you have any questions or problems, don't hesitate to ask our public [mailing list](https://groups.google.com/group/mapsforge-dev) for help.
## Features
- Java map library
- OpenGL vector-tile rendering
- Themeable vector layers
- Support for multiple tile sources:
- primary opensciencemap (.vtm)
- mapsforge files
- GeoJSON tiles
- bitmap: any quadtree-scheme tiles as texture
- OpenScienceMap vector tiles
- Mapsforge vector maps
- Mapbox vector tiles
- GeoJSON vector tiles
- Raster tiles: any quadtree-scheme tiles as texture
- Backends:
- Android (optional libGDX)
- Android
- iOS (using libGDX/RoboVM, [instructions](docs/ios.md))
- Desktop (using libGDX/LWJGL)
- HTML5/WebGL (using libGDX/GWT)
- HTML5/WebGL (using libGDX/GWT, [instructions](docs/web.md))
### Projects
- **vtm** contains the core library
- **vtm-android** Android backend (no libGDX required)
- **vtm-android-example** provides examples using **vtm-android**
- **vtm** core library
- **vtm-android** Android backend
- **vtm-android-example** Android examples
- **vtm-gdx** common libGDX backend
- **vtm-android-gdx** Android backend (with libGDX)
- **vtm-desktop** Desktop backend
- **vtm-ios** iOS backend
- **vtm-web** HTML5/GWT backend
- **vtm-android-gdx** Android libGDX backend
- **vtm-desktop** Desktop libGDX backend
- **vtm-playground** Desktop examples
- **vtm-ios** iOS libGDX backend
- **vtm-ios-example** iOS examples
- **vtm-web** HTML5/GWT libGDX backend
- **vtm-web-app** HTML5/GWT application
The libGDX backend for GWT is experimental.
## Applications
- VTM is used by many [applications](docs/Applications.md).
## WebGL Demo
[OpenScienceMap](http://opensciencemap.org/s3db/#scale=17,rot=61,tilt=51,lat=53.075,lon=8.807) view of Bremen.
- Hold right mouse button to change view direction.
## Applications
- VTM is used by many [applications](docs/Applications.md).
## Maps
- Mapsforge [map providers](docs/Mapsforge-Maps.md).
## Credits
This library contains code from several projects:
- **Android**: some Matrix code, TimSort (http://source.android.com)
- **libGDX**: AsyncTask, MathUtils and Interpolation classes (https://github.com/libgdx)
- **mapsforge**: based on 0.2.4 (https://github.com/mapsforge/mapsforge)
- **osmdroid**: some overlay classes (https://github.com/osmdroid/osmdroid)
- **tessellate**: (https://github.com/cscheid/tessellate)
- **Android** (Apache 2.0): some Matrix code, TimSort (http://source.android.com)
- **libGDX** (Apache 2.0): AsyncTask, MathUtils, Interpolation, PixmapPacker (https://github.com/libgdx)
- **mapsforge** (LGPL3): based on 0.2.4 (https://github.com/mapsforge/mapsforge)
- **osmdroid** (Apache 2.0): some overlay classes (https://github.com/osmdroid/osmdroid)
- **tessellate** (SGI Free Software License B 2.0): (https://github.com/cscheid/tessellate)
## Screenshots
![Screenshot Samples App Bremen 1](docs/images/screenshot-bremen-1.png)
![Screenthot Samples App Bremen 2](docs/images/screenshot-bremen-2.png)
### Android
![Android](docs/images/android.png)
### iOS
![iOS](docs/images/ios.png)
### Desktop
![Desktop](docs/images/desktop.png)
### Browser
![Browser](docs/images/browser.png)

View File

@@ -1,10 +1,11 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}
@@ -13,8 +14,10 @@ allprojects {
version = 'master-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.androidBuildVersionTools = "24.0.3"
ext.gdxVersion = "1.9.4"
ext.androidBuildVersionTools = "27.0.3"
ext.gdxVersion = "1.9.8"
ext.gwtVersion = "2.8.0"
ext.slf4jVersion = "1.7.25"
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
@@ -25,18 +28,20 @@ allprojects {
}
}
def androidCompileSdk() { return 24 }
static def androidCompileSdk() { return 27 }
def androidMinSdk() { return 10 }
// Minimum API Level by Support Library
static def androidMinSdk() { return 14 }
def androidTargetSdk() { return 22 }
static def androidTargetSdk() { return 22 }
def versionCode() { return 50 }
static def versionCode() { return 1 }
def versionName() { return version }
subprojects {
repositories {
google()
maven { url 'https://repo.boundlessgeo.com/main' }
jcenter()
}

View File

@@ -4,13 +4,11 @@ if (project.hasProperty("android")) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
exclude 'android-logger.properties'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
exclude 'android-logger.properties'
}
} else {
task sourcesJar(type: Jar) {

View File

@@ -1,8 +1,18 @@
# Applications using VTM software (in lexical order)
|**Name**|**Type**|**License/Cost**|**Sources**|
|--------|--------|----------------|-----------|
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Android / Desktop / iOS geocaching application | GPL/Free | Open |
| [Cruiser](http://wiki.openstreetmap.org/wiki/Cruiser) | Android / Desktop map and navigation application | Proprietary/Free | Closed |
|**Name**|**Type**|**License/Cost**|**Platforms**|**Sources**|
|--------|--------|----------------|-------------|-----------|
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Geocaching application | Apache 2.0/Free | Android, Desktop, iOS | Open |
| [Cruiser](http://wiki.openstreetmap.org/wiki/Cruiser) | Map and navigation application | Proprietary/Free | Android, Desktop | Closed |
| [GCDroid](https://play.google.com/store/apps/details?id=com.gcdroid) | Geocaching App | Proprietary/Free and Commercial | Android | Closed |
| [Hunt Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application for hunters | Proprietary/Free and Commercial | Android | Closed |
| [Kurviger](https://kurviger.de/en) | Route planner specialized on motorcyclists | Proprietary/Free and Commercial | Android | Closed |
| [MapTrek](http://maptrek.mobi) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
| [MyTourbook](http://mytourbook.sourceforge.net/mytourbook/) | Visualize and analyze tours | GPL2/Free | Desktop | Open |
| [Navi Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application | Proprietary/Free and Commercial | Android | Closed |
| Tokyo Ogiqvo | Visualize App | Commercial | [Android](https://play.google.com/store/apps/details?id=com.ogiqvo.view.tokyo&hl=ja), [iOS](https://itunes.apple.com/us/app/tokyo-ogiqvo/id1097100677?mt=8) | Closed |
| [topoGuide](http://www.topoguide.gr/index-en.php) | Digital guides for the outdoor | Proprietary/Free and Commercial | Android | Closed |
| [Ubitrek](https://play.google.com/store/apps/details?id=ubicarta.ubitrek) | Hiking with IGN maps | Proprietary/Free | Android | Closed |
| [VTM with Eclipse RCP](https://github.com/wolfgang-ch/vtm-with-rcp) | VTM with an Eclipse RCP application | GPL3/Free | Desktop | Open |
You know an application that is missing here? Please inform us by sending a message via our public [mailing list](https://groups.google.com/group/mapsforge-dev).

View File

@@ -1,24 +1,107 @@
# Changelog
## Version 0.6.X
## Version 0.9.2 (2018-01-04)
**Version 0.6.0-rc2 (2016-10-16)**
- Gradle fix transitive dependencies [#433](https://github.com/mapsforge/vtm/issues/433)
- libGDX 1.9.8 [#464](https://github.com/mapsforge/vtm/issues/464)
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.2)
- Location layer [#171](https://github.com/mapsforge/vtm/issues/171)
- Minor improvements and bug fixes
## Version 0.9.1 (2017-12-29)
**Version 0.6.0-rc1 (2016-10-08)**
- LwHttp engine fix http headers [#460](https://github.com/mapsforge/vtm/issues/460)
- S3DBLayer renamed to S3DBTileLayer [#452](https://github.com/mapsforge/vtm/issues/452)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.1)
**Revive of VTM vector map library**
## Version 0.9.0 (2017-12-03)
- Mapsforge maps **v5 beta** support [#429](https://github.com/mapsforge/vtm/issues/429)
- Mapsforge themes compatibility [#100](https://github.com/mapsforge/vtm/issues/100)
- Render themes: line symbol [#124](https://github.com/mapsforge/vtm/issues/124)
- Render themes: stroke dash array [#131](https://github.com/mapsforge/vtm/issues/131)
- PathLayer overlay touch events [#316](https://github.com/mapsforge/vtm/issues/316)
- VectorLayer (polygon) overlay touch events [#424](https://github.com/mapsforge/vtm/issues/424)
- Two finger tap zoom out gesture [#423](https://github.com/mapsforge/vtm/issues/423)
- POI Search example [#394](https://github.com/mapsforge/vtm/issues/394)
- Mapsforge Reverse Geocoding [#383](https://github.com/mapsforge/vtm/issues/383)
- Core utilities [#396](https://github.com/mapsforge/vtm/issues/396)
- MercatorProjection.groundResolution renamed to groundResolutionWithScale
- Map scaling improvements [#401](https://github.com/mapsforge/vtm/issues/401)
- Mapsforge fix artifacts zoom >17 [#231](https://github.com/mapsforge/vtm/issues/231)
- Mapzen building extrusions [#419](https://github.com/mapsforge/vtm/issues/419)
- BuildingLayer expects height tags in meters
- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405)
- PolyLabel default disabled [#402](https://github.com/mapsforge/vtm/issues/402)
- vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387)
- Feature parameters [#403](https://github.com/mapsforge/vtm/issues/403)
- vtm-android-gdx module enhancements [#435](https://github.com/mapsforge/vtm/issues/435)
- Gradle 4 / Android plugin 3 support [#433](https://github.com/mapsforge/vtm/issues/433)
- libGDX 1.9.7 [#434](https://github.com/mapsforge/vtm/issues/434)
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.0)
## Version 0.8.0 (2017-07-19)
- Real time (SVG) texture atlas [#63](https://github.com/mapsforge/vtm/issues/63)
- Marker clustering [#312](https://github.com/mapsforge/vtm/issues/312)
- Osmagray theme [#300](https://github.com/mapsforge/vtm/issues/300)
- Symbol rotation [#294](https://github.com/mapsforge/vtm/issues/294)
- Location renderer improvements [#317](https://github.com/mapsforge/vtm/issues/317)
- POT textures [#334](https://github.com/mapsforge/vtm/issues/334)
- OkHttp external cache [#135](https://github.com/mapsforge/vtm/issues/135)
- Texture atlas improvements [#301](https://github.com/mapsforge/vtm/pull/301) [#304](https://github.com/mapsforge/vtm/pull/304)
- vtm-json module [#367](https://github.com/mapsforge/vtm/issues/367)
- Mapzen GeoJSON vector tiles [#55](https://github.com/mapsforge/vtm/issues/55)
- vtm-ios-example module [#326](https://github.com/mapsforge/vtm/issues/326)
- Handle layers enabled state [#342](https://github.com/mapsforge/vtm/issues/342)
- Fix coord scale short overflow [#343](https://github.com/mapsforge/vtm/issues/343)
- Mapsforge map read improvements [#357](https://github.com/mapsforge/vtm/issues/357) [#370](https://github.com/mapsforge/vtm/issues/370)
- Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349)
- OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366)
- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338)
- libGDX 1.9.6 [#333](https://github.com/mapsforge/vtm/issues/333)
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0)
## Version 0.7.0 (2017-02-26)
- Mapsforge multiple map files [#208](https://github.com/mapsforge/vtm/issues/208)
- Improved gestures implementation [#253](https://github.com/mapsforge/vtm/issues/253)
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
- vtm-web modules update [#51](https://github.com/mapsforge/vtm/issues/51)
- Mapzen MVT vector tiles [#57](https://github.com/mapsforge/vtm/issues/57)
- SVG resources scaling in themes [#214](https://github.com/mapsforge/vtm/issues/214)
- Circle map style [#122](https://github.com/mapsforge/vtm/issues/122)
- Oneway arrows in themes [#275](https://github.com/mapsforge/vtm/issues/275)
- Texture atlas from bitmaps [#283](https://github.com/mapsforge/vtm/pull/283)
- PathLayer (vtm) fix disappearing segments [#108](https://github.com/mapsforge/vtm/issues/108)
- House numbers (nodes) fix visibility [#168](https://github.com/mapsforge/vtm/issues/168)
- Android fix quick scale vs long press [#250](https://github.com/mapsforge/vtm/issues/250)
- Use baseline 160dpi in scaling [#236](https://github.com/mapsforge/vtm/issues/236)
- OkHttp3 update [#138](https://github.com/mapsforge/vtm/issues/138)
- libGDX double tap zoom [#263](https://github.com/mapsforge/vtm/issues/263)
- MapFileTileSource zoom level API enhancements [#219](https://github.com/mapsforge/vtm/issues/219)
- Animator enhancements with easing functions [#246](https://github.com/mapsforge/vtm/issues/246)
- Tile grid layer scaling [#238](https://github.com/mapsforge/vtm/issues/238)
- Internal render themes new SVG resources [#251](https://github.com/mapsforge/vtm/issues/251)
- Fix theme parsing in non-Latin locales [#297](https://github.com/mapsforge/vtm/issues/297)
- libGDX 1.9.5 [#270](https://github.com/mapsforge/vtm/issues/270)
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.7.0)
## Version 0.6.0 (2016-10-28) - VTM revive
- Mapsforge maps **v4** support [#34](https://github.com/mapsforge/vtm/issues/34)
- Render theme SVG resources [#60](https://github.com/mapsforge/vtm/issues/60)
- Mapsforge multilingual maps [#34](https://github.com/mapsforge/vtm/issues/34)
- Render theme styles [#93](https://github.com/mapsforge/vtm/issues/93)
- vtm-ios module update [#29](https://github.com/mapsforge/vtm/issues/29)
- Native libraries for all platforms [#14](https://github.com/mapsforge/vtm/issues/14)
- Line stipple and texture rendering [#105](https://github.com/mapsforge/vtm/issues/105)
- Layer groups [#99](https://github.com/mapsforge/vtm/issues/99) [#103](https://github.com/mapsforge/vtm/issues/103)
- Location renderer [#171](https://github.com/mapsforge/vtm/issues/171)
- Location renderer and layer [#171](https://github.com/mapsforge/vtm/issues/171)
- Map scale bar [#84](https://github.com/mapsforge/vtm/issues/84)
- Tile size based on scale factor [#183](https://github.com/mapsforge/vtm/issues/183)
- libGDX layer gestures [#151](https://github.com/mapsforge/vtm/issues/151)
@@ -27,8 +110,10 @@
- GeoPoint & BoundingBox improvements [#201](https://github.com/mapsforge/vtm/issues/201) [#200](https://github.com/mapsforge/vtm/issues/200)
- vtm-jts module [#53](https://github.com/mapsforge/vtm/issues/53)
- vtm-http module [#140](https://github.com/mapsforge/vtm/issues/140)
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
- LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129)
- Available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22)
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
- libGDX 1.9.4 [#164](https://github.com/mapsforge/vtm/issues/164)
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.6.0)
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0)

View File

@@ -1,25 +1,49 @@
# Integration guide
This article describes how to integrate the library in your project.
This article describes how to integrate the library in your project, with Gradle / Maven / Jars or SNAPSHOT builds.
Current version is [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.mapsforge/vtm/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mapsforge/vtm)
Current version is [![Maven Central](https://img.shields.io/maven-central/v/org.mapsforge/vtm.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22)
## Gradle
### Core
```groovy
compile 'org.mapsforge:vtm:[CURRENT-VERSION]'
compile 'org.mapsforge:vtm-themes:[CURRENT-VERSION]'
compile 'org.slf4j:slf4j-api:1.7.21'
implementation 'org.mapsforge:vtm:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-themes:[CURRENT-VERSION]'
implementation 'org.slf4j:slf4j-api:1.7.25'
```
### Android
```groovy
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi'
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
compile 'com.caverock:androidsvg:1.2.2-beta-1'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-mips'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-mips64'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
implementation 'com.caverock:androidsvg:1.2.2-beta-1'
```
### Android (with libGDX)
```groovy
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.8'
implementation 'com.caverock:androidsvg:1.2.2-beta-1'
```
### iOS
@@ -28,24 +52,50 @@ Detailed iOS instructions can be found [here](ios.md).
### Desktop
```groovy
compile 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
compile 'com.badlogicgames.gdx:gdx:1.9.4'
compile 'com.badlogicgames.gdx:gdx-platform:1.9.4:natives-desktop'
compile 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.4'
compile 'org.lwjgl.lwjgl:lwjgl:2.9.3'
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
compile 'com.kitfox.svg:svg-salamander:1.0'
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
implementation 'com.badlogicgames.gdx:gdx-platform:1.9.8:natives-desktop'
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.8'
implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3'
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
implementation 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
```
### Optional
- JTS geometries
```groovy
implementation 'org.mapsforge:vtm-jts:[CURRENT-VERSION]'
implementation 'com.vividsolutions:jts:1.13'
```
- Online tiles
```groovy
implementation 'org.mapsforge:vtm-http:[CURRENT-VERSION]'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.squareup.okio:okio:1.13.0'
```
- GeoJSON tiles
```groovy
implementation 'org.mapsforge:vtm-json:[CURRENT-VERSION]'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.8.4'
implementation 'com.fasterxml.jackson.core:jackson-core:2.8.4'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
```
## Snapshots
We publish regularly SNAPSHOT builds to Sonatype OSS Repository Hosting.
We publish SNAPSHOT builds to Sonatype OSS Repository Hosting.
You need to add the repository:
```groovy
@@ -56,10 +106,17 @@ repositories {
And declare the dependencies like:
```groovy
compile 'org.mapsforge:vtm:master-SNAPSHOT'
implementation 'org.mapsforge:vtm:master-SNAPSHOT'
...
```
For checking latest snapshot on every build:
```groovy
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
```
## Maven
The dependencies for Maven are declared in a similar way. For example:
@@ -74,6 +131,6 @@ The dependencies for Maven are declared in a similar way. For example:
## Jars
You can find jars (regular and with dependencies) in Maven Central or Snapshots repositories.
You can find release and snapshot jars (regular and with dependencies) in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22) and [Sonatype OSS Repository Hosting](https://oss.sonatype.org/content/repositories/snapshots/org/mapsforge/).
Third party jars can be found at their respective sites or in Maven Central repository.

11
docs/Mapsforge-Maps.md Normal file
View File

@@ -0,0 +1,11 @@
# Mapsforge map providers (in lexical order)
- [AndroidMaps](http://www.androidmaps.co.uk/)
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
- [Kurviger](https://offline-maps.kurviger.de/)
- [Locusvectormaps](http://www.locusvectormaps.com)
- [Mapsforge](http://download.mapsforge.org/)
- [OpenAndroMaps](http://www.openandromaps.org/en/)
- [OpenMaps](http://openmaps.eu/)
You know a Mapsforge map provider that is missing here? Please inform us by sending a message via our public [mailing list](https://groups.google.com/group/mapsforge-dev).

BIN
docs/images/android.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

BIN
docs/images/browser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 KiB

BIN
docs/images/desktop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

BIN
docs/images/ios.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 827 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

7
docs/web.md Normal file
View File

@@ -0,0 +1,7 @@
### Web implementation
`./gradlew :vtm-web-app:farmRun` will run standalone web server at port 8080.
Then go to [http://localhost:8080/vtm-web-app](http://localhost:8080/vtm-web-app) in the web browser to see the map.
Hold right mouse button to change view direction.

View File

@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit

View File

@@ -1,6 +1,6 @@
#Tue Aug 16 13:14:49 EEST 2016
#Thu Oct 26 11:57:58 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

View File

@@ -1,7 +1,7 @@
apply plugin: 'java'
apply plugin: 'java-library'
dependencies {
compile "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
api "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
}
sourceSets {

View File

@@ -69,7 +69,7 @@
<xs:simpleType name="src">
<xs:restriction base="xs:string">
<xs:pattern value="(file|assets):.+" />
<xs:pattern value="((file|assets):)?.+" />
</xs:restriction>
</xs:simpleType>
@@ -84,6 +84,7 @@
<xs:restriction base="xs:string">
<xs:enumeration value="ele" />
<xs:enumeration value="addr:housenumber" />
<xs:enumeration value="addr_housenumber" /> <!-- Mapzen -->
<xs:enumeration value="name" />
<xs:enumeration value="ref" />
</xs:restriction>
@@ -124,6 +125,9 @@
<xs:attribute name="id" default="0" type="xs:string" use="optional" />
<xs:attribute name="use" default="0" type="xs:string" use="optional" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="stroke" default="#00000000" type="tns:color" use="optional" />
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
@@ -143,11 +147,15 @@
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
<!-- polygon area expressed as a ratio to tile area, e.g. 0.1 for 10% of tile area -->
<xs:attribute name="area-size" default="0" type="tns:nonNegativeFloat" use="optional" />
<!-- priority for label placement, 0 = highest priority -->
<xs:attribute name="priority" default="0" type="xs:integer" use="optional" />
<!-- symbol src name in atlas -->
<!-- symbol src name -->
<xs:attribute name="symbol" type="tns:src" use="optional" />
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
</xs:complexType>
<xs:complexType name="circle">
@@ -169,6 +177,9 @@
<xs:attribute name="use" default="0" type="xs:string" use="optional" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="width" default="0" type="xs:float" use="optional" />
<!-- minimum scaled width to draw outline -->
@@ -179,6 +190,8 @@
<xs:attribute name="fade" default="-1" type="xs:integer" use="optional" />
<xs:attribute name="blur" default="-1" type="xs:float" use="optional" />
<xs:attribute name="fix" default="false" type="xs:boolean" use="optional" />
<xs:attribute name="repeat-gap" default="200" type="xs:float" use="optional" />
<xs:attribute name="repeat-start" default="30" type="xs:float" use="optional" />
<!-- stipple repeat in 'pixel' -->
<xs:attribute name="stipple" default="0" type="xs:integer" use="optional" />
@@ -189,21 +202,6 @@
</xs:complexType>
<!--<xs:complexType name="outline">
<xs:attribute name="cat" type="xs:string" use="optional" />
<xs:attribute name="name" default="0" type="xs:string" use="optional" />
<xs:attribute name="src" type="tns:src" use="optional" />
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
</xs:complexType>-->
<xs:complexType name="lineSymbol">
<xs:attribute name="cat" type="xs:string" use="optional" />
<xs:attribute name="src" type="tns:src" use="required" />
<xs:attribute name="align-center" default="false" type="xs:boolean" use="optional" />
<xs:attribute name="repeat" default="false" type="xs:boolean" use="optional" />
</xs:complexType>
<xs:complexType name="text">
<xs:attribute name="cat" type="xs:string" use="optional" />
@@ -219,6 +217,8 @@
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
<xs:attribute name="caption" default="false" type="xs:boolean" use="optional" />
<!-- polygon area expressed as a ratio to tile area, e.g. 0.1 for 10% of tile area -->
<xs:attribute name="area-size" default="0" type="tns:nonNegativeFloat" use="optional" />
<!-- priority for label placement, 0 = highest priority -->
<xs:attribute name="priority" default="0" type="xs:integer" use="optional" />
</xs:complexType>
@@ -226,6 +226,9 @@
<xs:complexType name="symbol">
<xs:attribute name="cat" type="xs:string" use="optional" />
<xs:attribute name="src" type="tns:src" use="required" />
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
</xs:complexType>
<xs:complexType name="extrusion">
@@ -233,6 +236,8 @@
<xs:attribute name="line-color" type="tns:color" use="optional" />
<xs:attribute name="side-color" type="tns:color" use="required" />
<xs:attribute name="top-color" type="tns:color" use="required" />
<!-- 12m default -->
<xs:attribute name="default-height" default="12" type="xs:positiveInteger" use="optional" />
</xs:complexType>
<!-- match elements -->
@@ -246,7 +251,7 @@
<xs:element name="circle" type="tns:circle" />
<xs:element name="line" type="tns:line" />
<xs:element name="outline" type="tns:line" />
<xs:element name="lineSymbol" type="tns:lineSymbol" />
<xs:element name="lineSymbol" type="tns:line" />
<xs:element name="text" type="tns:text" />
<xs:element name="extrusion" type="tns:extrusion" />
<xs:element name="symbol" type="tns:symbol" />

View File

@@ -1,19 +1,22 @@
rootProject.name = 'vtm-parent'
include ':vtm'
include ':vtm-http'
include ':vtm-jts'
include ':vtm-tests'
include ':vtm-extras'
include ':vtm-android'
include ':vtm-android-example'
include ':vtm-themes'
include ':vtm-gdx'
include ':vtm-desktop'
include ':vtm-android-gdx'
//include ':vtm-web'
//include ':vtm-web-app'
//include ':vtm-web-js'
include ':vtm-jeo'
include ':vtm-playground'
include ':vtm-ios'
include ':vtm-app'
include ':vtm-desktop'
include ':vtm-extras'
include ':vtm-gdx'
include ':vtm-http'
include ':vtm-ios'
include ':vtm-ios-example'
include ':vtm-jeo'
include ':vtm-json'
include ':vtm-jts'
include ':vtm-playground'
include ':vtm-tests'
include ':vtm-theme-comparator'
include ':vtm-themes'
include ':vtm-web'
include ':vtm-web-app'
//include ':vtm-web-js'

View File

@@ -10,10 +10,6 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
@@ -26,9 +22,24 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AtlasMarkerOverlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".AtlasMultiTextureActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".AtlasThemeActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".BitmapTileMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".ClusterMarkerOverlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".GdxMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".JeoIndoorMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
@@ -47,6 +58,21 @@
<activity
android:name=".MapsforgeMapActivity$MapFilePicker"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapsforgeMapActivity$ThemeFilePicker"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapsforgePolyLabelActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapsforgeStyleActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapzenGeojsonMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MapzenMvtMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".MarkerOverlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
@@ -54,13 +80,31 @@
android:name=".MultiMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".OsmJsonMapActivity"
android:name=".NewGesturesActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".OpenMapTilesGeojsonMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".OSciMapS3DBMapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".PathOverlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".S3DBMapActivity"
android:name=".PoiSearchActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".PoiSearchActivity$PoiFilePicker"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".POTTextureActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".ReverseGeocodeActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".RotateMarkerOverlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".SimpleMapActivity"

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" map-background="#fffcfa"
version="1" xmlns="http://opensciencemap.org/rendertheme"
xsi:schemaLocation="http://opensciencemap.org/rendertheme https://raw.githubusercontent.com/mapsforge/vtm/master/resources/rendertheme.xsd">
<stylemenu defaultlang="en" defaultvalue="1" id="menu">
<layer enabled="true" id="nature">
<name lang="de" value="Natur" />
<name lang="en" value="Nature" />
<name lang="es" value="Naturaleza" />
<name lang="fr" value="Nature" />
<cat id="nature" />
</layer>
<layer id="base">
<cat id="sea" />
<cat id="land" />
</layer>
<!-- Show nature layers (enabled by default) -->
<layer id="1" parent="base" visible="true">
<name lang="de" value="1" />
<name lang="en" value="1" />
<name lang="es" value="1" />
<name lang="fr" value="1" />
<overlay id="nature" />
</layer>
<!-- Don't show nature layers -->
<layer id="2" parent="base" visible="true">
<name lang="de" value="2" />
<name lang="en" value="2" />
<name lang="es" value="2" />
<name lang="fr" value="2" />
</layer>
</stylemenu>
<m cat="sea" e="way" k="natural" v="issea|sea">
<area fill="#b5d6f1" mesh="true" />
</m>
<m cat="land" e="way" k="natural" v="nosea">
<area fill="#f8f8f8" mesh="true" />
</m>
<m cat="nature" e="way" k="natural|landuse" v="forest|wood">
<area fill="#83aa5b" />
</m>
</rendertheme>

View File

@@ -1,12 +1,26 @@
apply plugin: 'com.android.application'
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
compile project(':vtm-android')
compile project(':vtm-extras')
compile project(':vtm-jeo')
compile project(':vtm-jts')
compile project(':vtm-themes')
compile 'com.noveogroup.android:android-logger:1.3.6'
implementation project(':vtm-android')
implementation project(':vtm-http')
implementation project(':vtm-jeo')
implementation project(':vtm-json')
implementation project(':vtm-jts')
implementation project(':vtm-themes')
implementation "org.slf4j:slf4j-android:$slf4jVersion"
implementation project(':vtm-android-gdx')
implementation project(':vtm-gdx')
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-armeabi'
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-armeabi-v7a'
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-x86'
}
android {
@@ -22,6 +36,7 @@ android {
versionCode versionCode()
versionName versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {
@@ -34,6 +49,9 @@ android {
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
jniLibs.srcDirs += "${dir.path}/lib"
}
file("${rootDir}/vtm-android-gdx/natives").eachDir() { dir ->
jniLibs.srcDirs += "${dir.path}/lib"
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -0,0 +1,11 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<org.oscim.android.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View File

@@ -1,7 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_settings"
android:title="@string/menu_settings"
android:orderInCategory="100"
android:showAsAction="never" />
</menu>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group
android:id="@+id/styles"
android:checkableBehavior="single">
<item
android:id="@+id/style_1"
android:checked="true"
android:title="@string/style_1" />
<item
android:id="@+id/style_2"
android:title="@string/style_2" />
</group>
</menu>

View File

@@ -7,26 +7,27 @@
<item
android:id="@+id/theme_default"
android:checked="true"
android:showAsAction="never"
android:title="@string/theme_default"></item>
<item
android:id="@+id/theme_tubes"
android:showAsAction="never"
android:title="@string/theme_tubes"></item>
android:title="@string/theme_default" />
<item
android:id="@+id/theme_osmarender"
android:showAsAction="never"
android:title="@string/theme_osmarender"></item>
android:title="@string/theme_osmarender" />
<item
android:id="@+id/theme_osmagray"
android:title="@string/theme_osmagray" />
<item
android:id="@+id/theme_tubes"
android:title="@string/theme_tubes" />
<item
android:id="@+id/theme_newtron"
android:showAsAction="never"
android:title="@string/theme_newtron"></item>
android:title="@string/theme_newtron" />
<item
android:id="@+id/theme_external"
android:title="@string/theme_external" />
</group>
<item
android:id="@+id/gridlayer"
android:showAsAction="never"
android:checkable="true"
android:title="@string/menu_gridlayer"></item>
android:title="@string/menu_gridlayer" />
</menu>

View File

@@ -1,11 +1,12 @@
<resources>
<string name="app_name">VTM Samples</string>
<string name="menu_settings">Settings</string>
<string name="theme_default">Default</string>
<string name="theme_tubes">Tubes</string>
<string name="theme_osmarender">Osmarender</string>
<string name="theme_osmagray">Osmagray</string>
<string name="theme_tubes">Tubes</string>
<string name="theme_newtron">NewTron</string>
<string name="theme_external">External theme</string>
<string name="ok">OK</string>
<string name="cancel">Cancel</string>
<string name="error">Error</string>
@@ -14,6 +15,9 @@
<string name="styler_mode_area">Area</string>
<string name="styler_mode_outline">Outline</string>
<string name="styler_controls_toggle">Controls</string>
<string name="menu_gridlayer">Gridlayer</string>
<string name="style_1">Show nature</string>
<string name="style_2">Hide nature</string>
<string name="menu_gridlayer">Grid</string>
<string name="dialog_reverse_geocoding_title">Reverse Geocoding</string>
</resources>

View File

@@ -1 +0,0 @@
root=DEBUG:%logger

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -17,10 +18,13 @@ package org.oscim.android.filepicker;
import org.oscim.theme.ExternalRenderTheme;
import org.oscim.theme.ThemeFile;
import org.oscim.theme.ThemeUtils;
import org.oscim.theme.XmlMapsforgeThemeBuilder;
import org.oscim.theme.XmlThemeBuilder;
import org.oscim.tiling.TileSource.OpenResult;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import java.io.File;
@@ -34,9 +38,14 @@ public final class ValidRenderTheme implements ValidFileFilter {
@Override
public boolean accept(File file) {
try {
ThemeFile theme = new ExternalRenderTheme(file.getAbsolutePath());
XmlThemeBuilder renderThemeHandler = new XmlThemeBuilder(theme);
DefaultHandler renderThemeHandler;
if (ThemeUtils.isMapsforgeTheme(theme))
renderThemeHandler = new XmlMapsforgeThemeBuilder(theme);
else
renderThemeHandler = new XmlThemeBuilder(theme);
XMLReader xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
xmlReader.setContentHandler(renderThemeHandler);
xmlReader.parse(new InputSource(theme.getRenderThemeAsStream()));

View File

@@ -0,0 +1,97 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.core.GeoPoint;
import org.oscim.layers.marker.ItemizedLayer;
import org.oscim.layers.marker.MarkerItem;
import org.oscim.layers.marker.MarkerSymbol;
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.atlas.TextureAtlas;
import org.oscim.renderer.atlas.TextureRegion;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import org.oscim.utils.TextureAtlasUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
public class AtlasMarkerOverlayActivity extends MarkerOverlayActivity {
@Override
void createLayers() {
// Map events receiver
mMap.layers().add(new MapEventsReceiver(mMap));
TileSource tileSource = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.setTheme(VtmThemes.DEFAULT);
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
// Create Atlas from Bitmaps
java.util.Map<Object, Bitmap> inputMap = new LinkedHashMap<>();
java.util.Map<Object, TextureRegion> regionsMap = new LinkedHashMap<>();
List<TextureAtlas> atlasList = new ArrayList<>();
inputMap.put("poi", bitmapPoi);
inputMap.put("focus", bitmapFocus);
// Bitmaps will never used any more
// With iOS we must flip the Y-Axis
TextureAtlasUtils.createTextureRegions(inputMap, regionsMap, atlasList, true, false);
MarkerSymbol symbol;
if (BILLBOARDS)
symbol = new MarkerSymbol(regionsMap.get("poi"), HotspotPlace.BOTTOM_CENTER);
else
symbol = new MarkerSymbol(regionsMap.get("poi"), HotspotPlace.CENTER, false);
if (BILLBOARDS)
mFocusMarker = new MarkerSymbol(regionsMap.get("focus"), HotspotPlace.BOTTOM_CENTER);
else
mFocusMarker = new MarkerSymbol(regionsMap.get("focus"), HotspotPlace.CENTER, false);
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
mMap.layers().add(mMarkerLayer);
List<MarkerItem> pts = new ArrayList<>();
for (double lat = -90; lat <= 90; lat += 5) {
for (double lon = -180; lon <= 180; lon += 5)
pts.add(new MarkerItem(lat + "/" + lon, "", new GeoPoint(lat, lon)));
}
mMarkerLayer.addItems(pts);
}
}

View File

@@ -0,0 +1,120 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.widget.Toast;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.backend.canvas.Canvas;
import org.oscim.backend.canvas.Color;
import org.oscim.backend.canvas.Paint;
import org.oscim.core.GeoPoint;
import org.oscim.layers.marker.ItemizedLayer;
import org.oscim.layers.marker.MarkerItem;
import org.oscim.layers.marker.MarkerSymbol;
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.atlas.TextureAtlas;
import org.oscim.renderer.atlas.TextureRegion;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import org.oscim.utils.TextureAtlasUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
@Override
void createLayers() {
// Map events receiver
mMap.layers().add(new MapEventsReceiver(mMap));
TileSource tileSource = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.setTheme(VtmThemes.DEFAULT);
// Create Atlas from Bitmaps
java.util.Map<Object, Bitmap> inputMap = new LinkedHashMap<>();
java.util.Map<Object, TextureRegion> regionsMap = new LinkedHashMap<>();
List<TextureAtlas> atlasList = new ArrayList<>();
float scale = getResources().getDisplayMetrics().density;
Canvas canvas = CanvasAdapter.newCanvas();
Paint paint = CanvasAdapter.newPaint();
paint.setTypeface(Paint.FontFamily.DEFAULT, Paint.FontStyle.NORMAL);
paint.setTextSize(12 * scale);
paint.setStrokeWidth(2 * scale);
paint.setColor(Color.BLACK);
List<MarkerItem> pts = new ArrayList<>();
for (double lat = -90; lat <= 90; lat += 10) {
for (double lon = -180; lon <= 180; lon += 10) {
String title = lat + "/" + lon;
pts.add(new MarkerItem(title, "", new GeoPoint(lat, lon)));
Bitmap bmp = CanvasAdapter.newBitmap((int) (40 * scale), (int) (40 * scale), 0);
canvas.setBitmap(bmp);
canvas.fillColor(Color.GREEN);
canvas.drawText(Double.toString(lat), 3 * scale, 17 * scale, paint);
canvas.drawText(Double.toString(lon), 3 * scale, 35 * scale, paint);
inputMap.put(title, bmp);
}
}
// Bitmaps will never used any more
// With iOS we must flip the Y-Axis
TextureAtlasUtils.createTextureRegions(inputMap, regionsMap, atlasList, true, false);
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), (MarkerSymbol) null, this);
mMap.layers().add(mMarkerLayer);
mMarkerLayer.addItems(pts);
// set all markers
for (MarkerItem item : pts) {
MarkerSymbol markerSymbol = new MarkerSymbol(regionsMap.get(item.getTitle()), HotspotPlace.BOTTOM_CENTER);
item.setMarker(markerSymbol);
}
Toast.makeText(this, "Atlas count: " + atlasList.size(), Toast.LENGTH_SHORT).show();
}
@Override
public boolean onItemSingleTapUp(int index, MarkerItem item) {
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public boolean onItemLongPress(int index, MarkerItem item) {
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2017 Longri
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.utils.Parameters;
public class AtlasThemeActivity extends SimpleMapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
Parameters.TEXTURE_ATLAS = true;
super.onCreate(savedInstanceState);
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -26,6 +27,7 @@ import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +54,9 @@ public class BaseMapActivity extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mTileSource = new OSciMap4TileSource();
mTileSource = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
if (USE_CACHE) {
mCache = new TileCache(this, null, "tile.db");
@@ -85,13 +89,18 @@ public class BaseMapActivity extends MapActivity {
item.setChecked(true);
return true;
case R.id.theme_tubes:
mMap.setTheme(VtmThemes.TRONRENDER);
case R.id.theme_osmarender:
mMap.setTheme(VtmThemes.OSMARENDER);
item.setChecked(true);
return true;
case R.id.theme_osmarender:
mMap.setTheme(VtmThemes.OSMARENDER);
case R.id.theme_osmagray:
mMap.setTheme(VtmThemes.OSMAGRAY);
item.setChecked(true);
return true;
case R.id.theme_tubes:
mMap.setTheme(VtmThemes.TRONRENDER);
item.setChecked(true);
return true;
@@ -107,7 +116,7 @@ public class BaseMapActivity extends MapActivity {
} else {
item.setChecked(true);
if (mGridLayer == null)
mGridLayer = new TileGridLayer(mMap);
mGridLayer = new TileGridLayer(mMap, getResources().getDisplayMetrics().density);
mMap.layers().add(mGridLayer);
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -17,10 +18,8 @@ package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.android.cache.TileCache;
import org.oscim.backend.canvas.Color;
import org.oscim.core.MapPosition;
import org.oscim.core.MercatorProjection;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
import org.oscim.renderer.MapRenderer;
import org.oscim.tiling.source.bitmap.BitmapTileSource;
@@ -53,7 +52,6 @@ public class BitmapTileMapActivity extends MapActivity {
super.onCreate(savedInstanceState);
MapRenderer.setBackgroundColor(0xff777777);
mMap.layers().add(new TileGridLayer(mMap, Color.GRAY, 1.8f, 8));
if (mTileSource == null)
return;

View File

@@ -0,0 +1,107 @@
/*
* Copyright 2016-2017 devemux86
* Copyright 2017 nebular
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.backend.canvas.Color;
import org.oscim.core.GeoPoint;
import org.oscim.layers.marker.ClusterMarkerRenderer;
import org.oscim.layers.marker.ItemizedLayer;
import org.oscim.layers.marker.MarkerItem;
import org.oscim.layers.marker.MarkerLayer;
import org.oscim.layers.marker.MarkerRenderer;
import org.oscim.layers.marker.MarkerRendererFactory;
import org.oscim.layers.marker.MarkerSymbol;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import java.util.ArrayList;
import java.util.List;
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
private static final int COUNT = 5;
private static final float STEP = 100f / 110000f; // roughly 100 meters
@Override
void createLayers() {
// Map events receiver
mMap.layers().add(new MapEventsReceiver(mMap));
TileSource tileSource = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.setTheme(VtmThemes.DEFAULT);
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
final MarkerSymbol symbol;
if (BILLBOARDS)
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
else
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.CENTER, false);
MarkerRendererFactory markerRendererFactory = new MarkerRendererFactory() {
@Override
public MarkerRenderer create(MarkerLayer markerLayer) {
return new ClusterMarkerRenderer(markerLayer, symbol, new ClusterMarkerRenderer.ClusterStyle(Color.WHITE, Color.BLUE)) {
@Override
protected Bitmap getClusterBitmap(int size) {
// Can customize cluster bitmap here
return super.getClusterBitmap(size);
}
};
}
};
mMarkerLayer = new ItemizedLayer<>(
mMap,
new ArrayList<MarkerItem>(),
markerRendererFactory,
this);
mMap.layers().add(mMarkerLayer);
// Create some markers spaced STEP degrees
List<MarkerItem> pts = new ArrayList<>();
GeoPoint center = mMap.getMapPosition().getGeoPoint();
for (int x = -COUNT; x < COUNT; x++) {
for (int y = -COUNT; y < COUNT; y++) {
double random = STEP * Math.random() * 2;
MarkerItem item = new MarkerItem(y + ", " + x, "",
new GeoPoint(center.getLatitude() + y * STEP + random, center.getLongitude() + x * STEP + random)
);
pts.add(item);
}
}
mMarkerLayer.addItems(pts);
}
@Override
protected void onResume() {
super.onResume();
/* ignore saved position */
mMap.setMapPosition(53.08, 8.83, 1 << 15);
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.gdx;
package org.oscim.android.test;
import android.os.Bundle;
import android.util.DisplayMetrics;
@@ -28,10 +28,14 @@ import org.oscim.android.canvas.AndroidGraphics;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.GLAdapter;
import org.oscim.core.Tile;
import org.oscim.gdx.AndroidGL;
import org.oscim.gdx.GdxAssets;
import org.oscim.gdx.GdxMap;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
public class MainActivity extends AndroidApplication {
public class GdxMapActivity extends AndroidApplication {
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -42,8 +46,8 @@ public class MainActivity extends AndroidApplication {
GLAdapter.init(new AndroidGL());
DisplayMetrics metrics = getResources().getDisplayMetrics();
CanvasAdapter.dpi = (int) Math.max(metrics.xdpi, metrics.ydpi);
Tile.SIZE = Tile.calculateTileSize(metrics.scaledDensity);
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
Tile.SIZE = Tile.calculateTileSize();
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.stencil = 8;
@@ -57,8 +61,10 @@ public class MainActivity extends AndroidApplication {
class GdxMapAndroid extends GdxMap {
@Override
public void createLayers() {
TileSource ts = new OSciMap4TileSource();
initDefaultLayers(ts, true, true, true);
TileSource ts = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
}
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2016 devemux86
* Copyright 2014 Hannes Janetzek
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -24,11 +25,13 @@ import android.widget.ToggleButton;
import org.jeo.map.Style;
import org.jeo.vector.VectorDataset;
import org.oscim.backend.canvas.Color;
import org.oscim.layers.OSMIndoorLayer;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.test.JeoTest;
import org.oscim.theme.VtmThemes;
import org.oscim.theme.styles.TextStyle;
import org.oscim.utils.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,8 +46,7 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
public static final Logger log = LoggerFactory.getLogger(JeoIndoorMapActivity.class);
// from http://overpass-turbo.eu/s/2vp
String PATH = "https://gist.github.com/anonymous/8960337/raw/overpass.geojson";
//String PATH = "https://gist.github.com/hjanetzek/9280925/raw/overpass.geojson";
String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson";
private OSMIndoorLayer mIndoorLayer;
@@ -83,7 +85,6 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
// mMap.layers().add(new TileGridLayer(mMap));
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
// VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
// Style style = JeoTest.getStyle();
@@ -95,7 +96,13 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
VectorDataset data = JeoTest.readGeoJson(is);
Style style = JeoTest.getStyle();
mIndoorLayer = new OSMIndoorLayer(mMap, data, style);
float scale = getResources().getDisplayMetrics().density;
TextStyle textStyle = TextStyle.builder()
.isCaption(true)
.fontSize(16 * scale).color(Color.BLACK)
.strokeWidth(2.2f * scale).strokeColor(Color.WHITE)
.build();
mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle);
mMap.layers().add(mIndoorLayer);
showToast("data ready");
@@ -157,7 +164,8 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
i = 0;
mIndoorLayer.activeLevels[i] ^= true;
((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
if (v instanceof ToggleButton)
((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
log.debug(Arrays.toString(mIndoorLayer.activeLevels));
mIndoorLayer.update();
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2016 Andrey Novikov
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@@ -20,7 +20,6 @@ package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.backend.CanvasAdapter;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.map.Layers;
@@ -53,7 +52,7 @@ public class LayerGroupActivity extends BaseMapActivity {
layers.addGroup(GROUP_LABELS);
layers.add(new LabelLayer(mMap, mBaseLayer), GROUP_LABELS);
mapScaleBar = new DefaultMapScaleBar(mMap, CanvasAdapter.dpi / 160);
mapScaleBar = new DefaultMapScaleBar(mMap);
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
@@ -62,7 +61,7 @@ public class LayerGroupActivity extends BaseMapActivity {
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mapScaleBar);
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
renderer.setOffset(5 * CanvasAdapter.dpi / 160, 0);
renderer.setOffset(5 * getResources().getDisplayMetrics().density, 0);
layers.addGroup(GROUP_OVERLAYS);
layers.add(mapScaleBarLayer, GROUP_OVERLAYS);
@@ -72,7 +71,8 @@ public class LayerGroupActivity extends BaseMapActivity {
@Override
protected void onDestroy() {
mapScaleBar.destroy();
if (mapScaleBar != null)
mapScaleBar.destroy();
super.onDestroy();
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -28,32 +28,31 @@ import org.oscim.layers.vector.geometries.Style;
import org.oscim.map.Map;
import org.oscim.renderer.bucket.TextureItem;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER;
/**
* This is a very INEFFICIENT and somewhat less useful example for how to use
* PathLayers!
*/
public class LineTexActivity extends BitmapTileMapActivity {
public class LineTexActivity extends SimpleMapActivity {
private static final boolean ANIMATION = false;
private List<PathLayer> mPathLayers = new ArrayList<>();
public LineTexActivity() {
super(STAMEN_TONER.build());
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBitmapLayer.tileRenderer().setBitmapAlpha(0.5f);
TextureItem tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
tex.mipmap = true;
TextureItem tex = null;
try {
tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
tex.mipmap = true;
} catch (IOException e) {
e.printStackTrace();
}
for (double lat = -90; lat <= 90; lat += 5) {
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -22,6 +22,7 @@ import android.os.Bundle;
import org.oscim.core.MapPosition;
import org.oscim.layers.LocationLayer;
import org.oscim.renderer.LocationRenderer;
public class LocationActivity extends SimpleMapActivity implements LocationListener {
private LocationLayer locationLayer;
@@ -35,6 +36,8 @@ public class LocationActivity extends SimpleMapActivity implements LocationListe
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationLayer = new LocationLayer(mMap);
locationLayer.locationRenderer.setShader("location_1_reverse");
locationLayer.setEnabled(false);
mMap.layers().add(locationLayer);
}
@@ -43,7 +46,6 @@ public class LocationActivity extends SimpleMapActivity implements LocationListe
super.onResume();
enableAvailableProviders();
locationLayer.setEnabled(true);
}
@Override
@@ -51,11 +53,11 @@ public class LocationActivity extends SimpleMapActivity implements LocationListe
super.onPause();
locationManager.removeUpdates(this);
locationLayer.setEnabled(false);
}
@Override
public void onLocationChanged(Location location) {
locationLayer.setEnabled(true);
locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getAccuracy());
// Follow location

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -21,7 +21,6 @@ import android.os.Bundle;
import org.oscim.android.MapPreferences;
import org.oscim.android.MapView;
import org.oscim.core.Tile;
import org.oscim.map.Map;
public class MapActivity extends Activity {
@@ -41,7 +40,6 @@ public class MapActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
setContentView(mContentView);
setTitle(getClass().getSimpleName());
@@ -61,9 +59,16 @@ public class MapActivity extends Activity {
@Override
protected void onPause() {
super.onPause();
mMapView.onPause();
mPrefs.save(mMapView.map());
mMapView.onPause();
super.onPause();
}
@Override
protected void onDestroy() {
mMapView.onDestroy();
super.onDestroy();
}
}

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -25,20 +26,46 @@ import android.view.MenuItem;
import org.oscim.android.filepicker.FilePicker;
import org.oscim.android.filepicker.FilterByFileExtension;
import org.oscim.android.filepicker.ValidMapFile;
import org.oscim.android.filepicker.ValidRenderTheme;
import org.oscim.core.MapElement;
import org.oscim.core.MapPosition;
import org.oscim.core.Tag;
import org.oscim.core.Tile;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.MapTile;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.BitmapRenderer;
import org.oscim.renderer.GLViewport;
import org.oscim.renderer.bucket.RenderBuckets;
import org.oscim.scalebar.DefaultMapScaleBar;
import org.oscim.scalebar.ImperialUnitAdapter;
import org.oscim.scalebar.MapScaleBar;
import org.oscim.scalebar.MapScaleBarLayer;
import org.oscim.scalebar.MetricUnitAdapter;
import org.oscim.theme.ExternalRenderTheme;
import org.oscim.theme.ThemeUtils;
import org.oscim.theme.VtmThemes;
import org.oscim.theme.styles.AreaStyle;
import org.oscim.theme.styles.RenderStyle;
import org.oscim.tiling.source.mapfile.MapFileTileSource;
import org.oscim.tiling.source.mapfile.MapInfo;
public class MapsforgeMapActivity extends MapActivity {
private static final int SELECT_MAP_FILE = 0;
static final int SELECT_MAP_FILE = 0;
static final int SELECT_THEME_FILE = SELECT_MAP_FILE + 1;
private static final Tag ISSEA_TAG = new Tag("natural", "issea");
private static final Tag NOSEA_TAG = new Tag("natural", "nosea");
private static final Tag SEA_TAG = new Tag("natural", "sea");
private TileGridLayer mGridLayer;
private DefaultMapScaleBar mMapScaleBar;
private Menu mMenu;
private VectorTileLayer mTileLayer;
MapFileTileSource mTileSource;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -48,6 +75,14 @@ public class MapsforgeMapActivity extends MapActivity {
SELECT_MAP_FILE);
}
@Override
protected void onDestroy() {
if (mMapScaleBar != null)
mMapScaleBar.destroy();
super.onDestroy();
}
public static class MapFilePicker extends FilePicker {
public MapFilePicker() {
setFileDisplayFilter(new FilterByFileExtension(".map"));
@@ -55,9 +90,17 @@ public class MapsforgeMapActivity extends MapActivity {
}
}
public static class ThemeFilePicker extends FilePicker {
public ThemeFilePicker() {
setFileDisplayFilter(new FilterByFileExtension(".xml"));
setFileSelectFilter(new ValidRenderTheme());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.theme_menu, menu);
mMenu = menu;
return true;
}
@@ -70,13 +113,18 @@ public class MapsforgeMapActivity extends MapActivity {
item.setChecked(true);
return true;
case R.id.theme_tubes:
mMap.setTheme(VtmThemes.TRONRENDER);
case R.id.theme_osmarender:
mMap.setTheme(VtmThemes.OSMARENDER);
item.setChecked(true);
return true;
case R.id.theme_osmarender:
mMap.setTheme(VtmThemes.OSMARENDER);
case R.id.theme_osmagray:
mMap.setTheme(VtmThemes.OSMAGRAY);
item.setChecked(true);
return true;
case R.id.theme_tubes:
mMap.setTheme(VtmThemes.TRONRENDER);
item.setChecked(true);
return true;
@@ -85,6 +133,11 @@ public class MapsforgeMapActivity extends MapActivity {
item.setChecked(true);
return true;
case R.id.theme_external:
startActivityForResult(new Intent(this, ThemeFilePicker.class),
SELECT_THEME_FILE);
return true;
case R.id.gridlayer:
if (item.isChecked()) {
item.setChecked(false);
@@ -92,7 +145,7 @@ public class MapsforgeMapActivity extends MapActivity {
} else {
item.setChecked(true);
if (mGridLayer == null)
mGridLayer = new TileGridLayer(mMap);
mGridLayer = new TileGridLayer(mMap, getResources().getDisplayMetrics().density);
mMap.layers().add(mGridLayer);
}
@@ -112,24 +165,68 @@ public class MapsforgeMapActivity extends MapActivity {
return;
}
MapFileTileSource tileSource = new MapFileTileSource();
tileSource.setPreferredLanguage("en");
mTileSource = new MapFileTileSource();
//mTileSource.setPreferredLanguage("en");
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
if (tileSource.setMapFile(file)) {
if (mTileSource.setMapFile(file)) {
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.setTheme(VtmThemes.DEFAULT);
mTileLayer = mMap.setBaseMap(mTileSource);
loadTheme(null);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.layers().add(new BuildingLayer(mMap, mTileLayer));
mMap.layers().add(new LabelLayer(mMap, mTileLayer));
MapInfo info = tileSource.getMapInfo();
mMapScaleBar = new DefaultMapScaleBar(mMap);
mMapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
mMapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
mMapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
mMapScaleBar.setScaleBarPosition(MapScaleBar.ScaleBarPosition.BOTTOM_LEFT);
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mMapScaleBar);
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
renderer.setOffset(5 * getResources().getDisplayMetrics().density, 0);
mMap.layers().add(mapScaleBarLayer);
MapInfo info = mTileSource.getMapInfo();
MapPosition pos = new MapPosition();
pos.setByBoundingBox(info.boundingBox, Tile.SIZE * 4, Tile.SIZE * 4);
mMap.setMapPosition(pos);
mPrefs.clear();
}
} else if (requestCode == SELECT_THEME_FILE) {
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
return;
}
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
ExternalRenderTheme externalRenderTheme = new ExternalRenderTheme(file);
// Use tessellation with sea and land for Mapsforge themes
if (ThemeUtils.isMapsforgeTheme(externalRenderTheme)) {
mTileLayer.addHook(new VectorTileLayer.TileLoaderThemeHook() {
@Override
public boolean process(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level) {
if (element.tags.contains(ISSEA_TAG) || element.tags.contains(SEA_TAG) || element.tags.contains(NOSEA_TAG)) {
if (style instanceof AreaStyle)
((AreaStyle) style).mesh = true;
}
return false;
}
@Override
public void complete(MapTile tile, boolean success) {
}
});
}
mMap.setTheme(externalRenderTheme);
mMenu.findItem(R.id.theme_external).setChecked(true);
}
}
protected void loadTheme(final String styleId) {
mMap.setTheme(VtmThemes.DEFAULT);
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.utils.Parameters;
public class MapsforgePolyLabelActivity extends MapsforgeMapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Parameters.POLY_LABEL = true;
super.onCreate(savedInstanceState);
}
}

View File

@@ -0,0 +1,89 @@
/*
* Copyright 2016-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import org.oscim.android.theme.AssetsRenderTheme;
import org.oscim.theme.XmlRenderThemeMenuCallback;
import org.oscim.theme.XmlRenderThemeStyleLayer;
import org.oscim.theme.XmlRenderThemeStyleMenu;
import java.util.Set;
/**
* Load render theme from Android assets folder and show a configuration menu based on stylemenu.
*/
public class MapsforgeStyleActivity extends MapsforgeMapActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.style_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.style_1:
item.setChecked(true);
loadTheme("1");
mMap.clearMap();
Toast.makeText(this, "Show nature layers", Toast.LENGTH_SHORT).show();
return true;
case R.id.style_2:
item.setChecked(true);
loadTheme("2");
mMap.clearMap();
Toast.makeText(this, "Hide nature layers", Toast.LENGTH_SHORT).show();
return true;
default:
return false;
}
}
@Override
protected void loadTheme(final String styleId) {
mMap.setTheme(new AssetsRenderTheme(getAssets(), "", "vtm/stylemenu.xml", new XmlRenderThemeMenuCallback() {
@Override
public Set<String> getCategories(XmlRenderThemeStyleMenu renderThemeStyleMenu) {
// Use the selected style or the default
String style = styleId != null ? styleId : renderThemeStyleMenu.getDefaultValue();
// Retrieve the layer from the style id
XmlRenderThemeStyleLayer renderThemeStyleLayer = renderThemeStyleMenu.getLayer(style);
if (renderThemeStyleLayer == null) {
System.err.println("Invalid style " + style);
return null;
}
// First get the selected layer's categories that are enabled together
Set<String> categories = renderThemeStyleLayer.getCategories();
// Then add the selected layer's overlays that are enabled individually
// Here we use the style menu, but users can use their own preferences
for (XmlRenderThemeStyleLayer overlay : renderThemeStyleLayer.getOverlays()) {
if (overlay.isEnabled())
categories.addAll(overlay.getCategories());
}
// This is the whole categories set to be enabled
return categories;
}
}));
}
}

View File

@@ -0,0 +1,68 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.android.cache.TileCache;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.UrlTileSource;
import org.oscim.tiling.source.geojson.MapzenGeojsonTileSource;
public class MapzenGeojsonMapActivity extends MapActivity {
private static final boolean USE_CACHE = false;
private TileCache mCache;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UrlTileSource tileSource = MapzenGeojsonTileSource.builder()
.apiKey("mapzen-xxxxxxx") // Put a proper API key
.httpFactory(new OkHttpEngine.OkHttpFactory())
//.locale("en")
.build();
if (USE_CACHE) {
// Cache the tiles into a local SQLite database
mCache = new TileCache(this, null, "tile.db");
mCache.setCacheSize(512 * (1 << 10));
tileSource.setCache(mCache);
}
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.setTheme(VtmThemes.MAPZEN);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.layers().add(new TileGridLayer(mMap, getResources().getDisplayMetrics().density));
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mCache != null)
mCache.dispose();
}
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright 2016-2017 devemux86
* Copyright 2017 Mathieu De Brito
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.android.cache.TileCache;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.UrlTileSource;
import org.oscim.tiling.source.mvt.MapzenMvtTileSource;
public class MapzenMvtMapActivity extends MapActivity {
private static final boolean USE_CACHE = false;
private TileCache mCache;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UrlTileSource tileSource = MapzenMvtTileSource.builder()
.apiKey("mapzen-xxxxxxx") // Put a proper API key
.httpFactory(new OkHttpEngine.OkHttpFactory())
//.locale("en")
.build();
if (USE_CACHE) {
// Cache the tiles into a local SQLite database
mCache = new TileCache(this, null, "tile.db");
mCache.setCacheSize(512 * (1 << 10));
tileSource.setCache(mCache);
}
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.setTheme(VtmThemes.MAPZEN);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.layers().add(new TileGridLayer(mMap, getResources().getDisplayMetrics().density));
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mCache != null)
mCache.dispose();
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -17,60 +17,67 @@
*/
package org.oscim.android.test;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.Toast;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.core.GeoPoint;
import org.oscim.layers.TileGridLayer;
import org.oscim.event.Gesture;
import org.oscim.event.GestureListener;
import org.oscim.event.MotionEvent;
import org.oscim.layers.Layer;
import org.oscim.layers.marker.ItemizedLayer;
import org.oscim.layers.marker.MarkerItem;
import org.oscim.layers.marker.MarkerSymbol;
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.map.Map;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
import java.util.ArrayList;
import java.util.List;
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER;
public class MarkerOverlayActivity extends BitmapTileMapActivity
public class MarkerOverlayActivity extends SimpleMapActivity
implements ItemizedLayer.OnItemGestureListener<MarkerItem> {
private static final boolean BILLBOARDS = true;
private MarkerSymbol mFocusMarker;
public MarkerOverlayActivity() {
super(STAMEN_TONER.build());
}
static final boolean BILLBOARDS = true;
MarkerSymbol mFocusMarker;
ItemizedLayer<MarkerItem> mMarkerLayer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBitmapLayer.tileRenderer().setBitmapAlpha(0.5f);
void createLayers() {
// Map events receiver
mMap.layers().add(new MapEventsReceiver(mMap));
/* directly load bitmap from resources */
Bitmap bitmap = drawableToBitmap(getResources(), R.drawable.marker_poi);
TileSource tileSource = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.setTheme(VtmThemes.DEFAULT);
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
MarkerSymbol symbol;
if (BILLBOARDS)
symbol = new MarkerSymbol(bitmap, HotspotPlace.BOTTOM_CENTER);
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.BOTTOM_CENTER);
else
symbol = new MarkerSymbol(bitmap, HotspotPlace.CENTER, false);
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.CENTER, false);
/* another option: use some bitmap drawable */
Drawable d = getResources().getDrawable(R.drawable.marker_focus);
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
if (BILLBOARDS)
mFocusMarker = new MarkerSymbol(drawableToBitmap(d), HotspotPlace.BOTTOM_CENTER);
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.BOTTOM_CENTER);
else
mFocusMarker = new MarkerSymbol(drawableToBitmap(d), HotspotPlace.CENTER, false);
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.CENTER, false);
ItemizedLayer<MarkerItem> markerLayer =
new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(),
symbol, this);
mMap.layers().add(markerLayer);
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
mMap.layers().add(mMarkerLayer);
List<MarkerItem> pts = new ArrayList<>();
@@ -79,9 +86,7 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
pts.add(new MarkerItem(lat + "/" + lon, "", new GeoPoint(lat, lon)));
}
markerLayer.addItems(pts);
mMap.layers().add(new TileGridLayer(mMap));
mMarkerLayer.addItems(pts);
}
@Override
@@ -99,13 +104,40 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
else
item.setMarker(null);
Toast toast = Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT);
toast.show();
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public boolean onItemLongPress(int index, MarkerItem item) {
return false;
if (item.getMarker() == null)
item.setMarker(mFocusMarker);
else
item.setMarker(null);
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
class MapEventsReceiver extends Layer implements GestureListener {
MapEventsReceiver(Map map) {
super(map);
}
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap) {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
Toast.makeText(MarkerOverlayActivity.this, "Map tap\n" + p, Toast.LENGTH_SHORT).show();
return true;
}
if (g instanceof Gesture.LongPress) {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
Toast.makeText(MarkerOverlayActivity.this, "Map long press\n" + p, Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2016 Marvin W
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -22,12 +22,13 @@ import android.os.Bundle;
import org.oscim.android.MapPreferences;
import org.oscim.android.MapView;
import org.oscim.core.Tile;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.map.Map;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
public class MultiMapActivity extends Activity {
@@ -36,7 +37,6 @@ public class MultiMapActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
setContentView(R.layout.activity_map_multi);
setTitle(getClass().getSimpleName());
@@ -45,7 +45,10 @@ public class MultiMapActivity extends Activity {
mMapView1 = (MapView) findViewById(R.id.mapView1);
Map map1 = mMapView1.map();
mPrefs1 = new MapPreferences(MultiMapActivity.class.getName() + "1", this);
VectorTileLayer baseLayer1 = map1.setBaseMap(new OSciMap4TileSource());
TileSource tileSource1 = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer baseLayer1 = map1.setBaseMap(tileSource1);
map1.layers().add(new BuildingLayer(map1, baseLayer1));
map1.layers().add(new LabelLayer(map1, baseLayer1));
map1.setTheme(VtmThemes.DEFAULT);
@@ -54,7 +57,10 @@ public class MultiMapActivity extends Activity {
mMapView2 = (MapView) findViewById(R.id.mapView2);
Map map2 = mMapView2.map();
mPrefs2 = new MapPreferences(MultiMapActivity.class.getName() + "2", this);
VectorTileLayer baseLayer2 = map2.setBaseMap(new OSciMap4TileSource());
TileSource tileSource2 = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer baseLayer2 = map2.setBaseMap(tileSource2);
map2.layers().add(new BuildingLayer(map2, baseLayer2));
map2.layers().add(new LabelLayer(map2, baseLayer2));
map2.setTheme(VtmThemes.DEFAULT);

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2016-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import org.oscim.utils.Parameters;
public class NewGesturesActivity extends MarkerOverlayActivity {
public NewGesturesActivity() {
super();
Parameters.MAP_EVENT_LAYER2 = true;
}
@Override
protected void onDestroy() {
super.onDestroy();
// Revert gestures for other activities
Parameters.MAP_EVENT_LAYER2 = false;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -20,13 +20,14 @@ import android.os.Bundle;
import org.oscim.android.cache.TileCache;
import org.oscim.layers.tile.TileLayer;
import org.oscim.layers.tile.buildings.S3DBLayer;
import org.oscim.layers.tile.buildings.S3DBTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
public class S3DBMapActivity extends BaseMapActivity {
public class OSciMapS3DBMapActivity extends BaseMapActivity {
TileCache mS3dbCache;
@@ -37,6 +38,7 @@ public class S3DBMapActivity extends BaseMapActivity {
mMap.setTheme(VtmThemes.DEFAULT);
TileSource ts = OSciMap4TileSource.builder()
.httpFactory(new OkHttpEngine.OkHttpFactory())
.url("http://opensciencemap.org/tiles/s3db")
.zoomMin(16)
.zoomMax(16)
@@ -47,7 +49,7 @@ public class S3DBMapActivity extends BaseMapActivity {
mS3dbCache.setCacheSize(512 * (1 << 10));
ts.setCache(mS3dbCache);
}
TileLayer tl = new S3DBLayer(mMap, ts, true, false);
TileLayer tl = new S3DBTileLayer(mMap, ts, true, false);
mMap.layers().add(tl);
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
}

View File

@@ -0,0 +1,68 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.android.cache.TileCache;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.UrlTileSource;
import org.oscim.tiling.source.geojson.OpenMapTilesGeojsonTileSource;
public class OpenMapTilesGeojsonMapActivity extends MapActivity {
private static final boolean USE_CACHE = false;
private TileCache mCache;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UrlTileSource tileSource = OpenMapTilesGeojsonTileSource.builder()
.apiKey("xxxxxxx") // Put a proper API key
.httpFactory(new OkHttpEngine.OkHttpFactory())
//.locale("en")
.build();
if (USE_CACHE) {
// Cache the tiles into a local SQLite database
mCache = new TileCache(this, null, "tile.db");
mCache.setCacheSize(512 * (1 << 10));
tileSource.setCache(mCache);
}
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.setTheme(VtmThemes.OPENMAPTILES);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.layers().add(new TileGridLayer(mMap, getResources().getDisplayMetrics().density));
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mCache != null)
mCache.dispose();
}
}

View File

@@ -1,72 +0,0 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.IRenderTheme;
import org.oscim.theme.ThemeLoader;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.source.geojson.OsmBuildingJsonTileSource;
import org.oscim.tiling.source.geojson.OsmLanduseJsonTileSource;
import org.oscim.tiling.source.geojson.OsmRoadLabelJsonTileSource;
import org.oscim.tiling.source.geojson.OsmRoadLineJsonTileSource;
import org.oscim.tiling.source.geojson.OsmWaterJsonTileSource;
public class OsmJsonMapActivity extends MapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IRenderTheme theme = ThemeLoader.load(VtmThemes.DEFAULT);
mMap.setBaseMap(new VectorTileLayer(mMap, new OsmLanduseJsonTileSource()));
mMap.setTheme(theme);
VectorTileLayer l = new VectorTileLayer(mMap, new OsmWaterJsonTileSource());
l.setRenderTheme(theme);
l.tileRenderer().setOverdrawColor(0);
mMap.layers().add(l);
l = new VectorTileLayer(mMap, new OsmRoadLineJsonTileSource());
l.setRenderTheme(theme);
l.tileRenderer().setOverdrawColor(0);
mMap.layers().add(l);
l = new VectorTileLayer(mMap, new OsmBuildingJsonTileSource());
l.setRenderTheme(theme);
l.tileRenderer().setOverdrawColor(0);
mMap.layers().add(l);
mMap.layers().add(new BuildingLayer(mMap, l));
l = new VectorTileLayer(mMap, new OsmRoadLabelJsonTileSource());
l.setRenderTheme(theme);
l.tileRenderer().setOverdrawColor(0);
mMap.layers().add(l);
mMap.layers().add(new LabelLayer(mMap, l));
mMap.layers().add(new TileGridLayer(mMap));
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 16));
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.utils.Parameters;
public class POTTextureActivity extends SimpleMapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
Parameters.POT_TEXTURES = true;
super.onCreate(savedInstanceState);
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -18,40 +18,48 @@
package org.oscim.android.test;
import android.os.Bundle;
import android.widget.Toast;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Color;
import org.oscim.core.MapPosition;
import org.oscim.event.Event;
import org.oscim.event.Gesture;
import org.oscim.event.MotionEvent;
import org.oscim.layers.vector.PathLayer;
import org.oscim.map.Map.UpdateListener;
import java.util.ArrayList;
import java.util.List;
import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER;
/**
* This is a very INEFFICIENT and somewhat less useful example for how to use
* PathLayers!
*/
public class PathOverlayActivity extends BitmapTileMapActivity {
public class PathOverlayActivity extends SimpleMapActivity {
private static final boolean ANIMATION = true;
private List<PathLayer> mPathLayers = new ArrayList<>();
public PathOverlayActivity() {
super(STAMEN_TONER.build());
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBitmapLayer.tileRenderer().setBitmapAlpha(0.5f);
for (double lat = -90; lat <= 90; lat += 5) {
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);
PathLayer pathLayer = new PathLayer(mMap, c, 6);
PathLayer pathLayer = new PathLayer(mMap, c, 6 * CanvasAdapter.getScale()) {
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap) {
if (contains(e.getX(), e.getY())) {
Toast.makeText(PathOverlayActivity.this, "PathLayer tap\n" + mMap.viewport().fromScreenPoint(e.getX(), e.getY()), Toast.LENGTH_SHORT).show();
return true;
}
}
return false;
}
};
mMap.layers().add(pathLayer);
mPathLayers.add(pathLayer);
}

View File

@@ -0,0 +1,193 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.widget.Toast;
import org.mapsforge.poi.android.storage.AndroidPoiPersistenceManagerFactory;
import org.mapsforge.poi.storage.ExactMatchPoiCategoryFilter;
import org.mapsforge.poi.storage.PoiCategoryFilter;
import org.mapsforge.poi.storage.PoiCategoryManager;
import org.mapsforge.poi.storage.PoiPersistenceManager;
import org.mapsforge.poi.storage.PointOfInterest;
import org.oscim.android.filepicker.FilePicker;
import org.oscim.android.filepicker.FilterByFileExtension;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.core.BoundingBox;
import org.oscim.core.GeoPoint;
import org.oscim.event.Gesture;
import org.oscim.event.GestureListener;
import org.oscim.event.MotionEvent;
import org.oscim.layers.Layer;
import org.oscim.layers.marker.ItemizedLayer;
import org.oscim.layers.marker.MarkerItem;
import org.oscim.layers.marker.MarkerSymbol;
import org.oscim.map.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
/**
* POI search.<br/>
* Long press on map to search inside visible bounding box.<br/>
* Tap on POIs to show their name (in default locale).
*/
public class PoiSearchActivity extends MapsforgeMapActivity implements ItemizedLayer.OnItemGestureListener<MarkerItem> {
private static final Logger log = LoggerFactory.getLogger(PoiSearchActivity.class);
private static String POI_FILE;
private static final String POI_CATEGORY = "Restaurants";
private static final int SELECT_POI_FILE = MapsforgeMapActivity.SELECT_THEME_FILE + 1;
private ItemizedLayer<MarkerItem> mMarkerLayer;
public static class PoiFilePicker extends FilePicker {
public PoiFilePicker() {
setFileDisplayFilter(new FilterByFileExtension(".poi"));
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Map events receiver
mMap.layers().add(new PoiSearchActivity.MapEventsReceiver(mMap));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == SELECT_MAP_FILE) {
if (mTileSource != null)
startActivityForResult(new Intent(this, PoiFilePicker.class),
SELECT_POI_FILE);
else
finish();
} else if (requestCode == SELECT_POI_FILE) {
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
finish();
return;
}
POI_FILE = intent.getStringExtra(FilePicker.SELECTED_FILE);
Bitmap bitmap = drawableToBitmap(getResources().getDrawable(R.drawable.marker_green));
MarkerSymbol symbol = new MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
mMap.layers().add(mMarkerLayer);
}
}
@Override
public boolean onItemSingleTapUp(int index, MarkerItem item) {
Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public boolean onItemLongPress(int index, MarkerItem item) {
return false;
}
private class MapEventsReceiver extends Layer implements GestureListener {
MapEventsReceiver(Map map) {
super(map);
}
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.LongPress) {
// Clear overlays
mMarkerLayer.removeAllItems();
mMap.render();
// POI search
new PoiSearchTask(PoiSearchActivity.this, POI_CATEGORY).execute(mMap.getBoundingBox(0));
return true;
}
return false;
}
}
private class PoiSearchTask extends AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
private final WeakReference<PoiSearchActivity> weakActivity;
private final String category;
private PoiSearchTask(PoiSearchActivity activity, String category) {
this.weakActivity = new WeakReference<>(activity);
this.category = category;
}
@Override
protected Collection<PointOfInterest> doInBackground(BoundingBox... params) {
// Search POI
PoiPersistenceManager persistenceManager = null;
try {
persistenceManager = AndroidPoiPersistenceManagerFactory.getPoiPersistenceManager(POI_FILE);
PoiCategoryManager categoryManager = persistenceManager.getCategoryManager();
PoiCategoryFilter categoryFilter = new ExactMatchPoiCategoryFilter();
categoryFilter.addCategory(categoryManager.getPoiCategoryByTitle(category));
org.mapsforge.core.model.BoundingBox bb = new org.mapsforge.core.model.BoundingBox(
params[0].getMinLatitude(), params[0].getMinLongitude(),
params[0].getMaxLatitude(), params[0].getMaxLongitude());
return persistenceManager.findInRect(bb, categoryFilter, null, Integer.MAX_VALUE);
} catch (Throwable t) {
log.error(t.getMessage(), t);
} finally {
if (persistenceManager != null) {
persistenceManager.close();
}
}
return null;
}
@Override
protected void onPostExecute(Collection<PointOfInterest> pointOfInterests) {
PoiSearchActivity activity = weakActivity.get();
if (activity == null) {
return;
}
Toast.makeText(activity, category + ": " + (pointOfInterests != null ? pointOfInterests.size() : 0), Toast.LENGTH_SHORT).show();
if (pointOfInterests == null) {
return;
}
// Overlay POI
List<MarkerItem> pts = new ArrayList<>();
for (PointOfInterest pointOfInterest : pointOfInterests)
pts.add(new MarkerItem(pointOfInterest.getName(), "", new GeoPoint(pointOfInterest.getLatitude(), pointOfInterest.getLongitude())));
mMarkerLayer.addItems(pts);
mMap.render();
}
}
}

View File

@@ -0,0 +1,145 @@
/*
* Copyright 2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import org.oscim.backend.CanvasAdapter;
import org.oscim.core.GeoPoint;
import org.oscim.core.GeometryBuffer;
import org.oscim.core.MercatorProjection;
import org.oscim.core.Point;
import org.oscim.core.Tag;
import org.oscim.core.Tile;
import org.oscim.event.Gesture;
import org.oscim.event.GestureListener;
import org.oscim.event.MotionEvent;
import org.oscim.layers.Layer;
import org.oscim.layers.TileGridLayer;
import org.oscim.map.Map;
import org.oscim.tiling.source.mapfile.MapDatabase;
import org.oscim.tiling.source.mapfile.MapReadResult;
import org.oscim.tiling.source.mapfile.PointOfInterest;
import org.oscim.tiling.source.mapfile.Way;
import org.oscim.utils.GeoPointUtils;
import java.util.List;
/**
* Reverse Geocoding with long press.
* <p/>
* - POI in specified radius.<br/>
* - Ways containing touch point.
*/
public class ReverseGeocodeActivity extends MapsforgeMapActivity {
private static final int TOUCH_RADIUS = 32 / 2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Map events receiver
mMap.layers().add(new MapEventsReceiver(mMap));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == SELECT_MAP_FILE) {
// For debug
TileGridLayer gridLayer = new TileGridLayer(mMap, getResources().getDisplayMetrics().density);
mMap.layers().add(gridLayer);
}
}
private class MapEventsReceiver extends Layer implements GestureListener {
MapEventsReceiver(Map map) {
super(map);
}
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.LongPress) {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
// Read all labeled POI and ways for the area covered by the tiles under touch
float touchRadius = TOUCH_RADIUS * CanvasAdapter.getScale();
long mapSize = MercatorProjection.getMapSize((byte) mMap.getMapPosition().getZoomLevel());
double pixelX = MercatorProjection.longitudeToPixelX(p.getLongitude(), mapSize);
double pixelY = MercatorProjection.latitudeToPixelY(p.getLatitude(), mapSize);
int tileXMin = MercatorProjection.pixelXToTileX(pixelX - touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
int tileXMax = MercatorProjection.pixelXToTileX(pixelX + touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
int tileYMin = MercatorProjection.pixelYToTileY(pixelY - touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
int tileYMax = MercatorProjection.pixelYToTileY(pixelY + touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
Tile upperLeft = new Tile(tileXMin, tileYMin, (byte) mMap.getMapPosition().getZoomLevel());
Tile lowerRight = new Tile(tileXMax, tileYMax, (byte) mMap.getMapPosition().getZoomLevel());
MapReadResult mapReadResult = ((MapDatabase) mTileSource.getDataSource()).readLabels(upperLeft, lowerRight);
StringBuilder sb = new StringBuilder();
// Filter POI
sb.append("*** POI ***");
for (PointOfInterest pointOfInterest : mapReadResult.pointOfInterests) {
Point layerXY = new Point();
mMap.viewport().toScreenPoint(pointOfInterest.position, false, layerXY);
Point tapXY = new Point(e.getX(), e.getY());
if (layerXY.distance(tapXY) > touchRadius) {
continue;
}
sb.append("\n");
List<Tag> tags = pointOfInterest.tags;
for (Tag tag : tags) {
sb.append("\n").append(tag.key).append("=").append(tag.value);
}
}
// Filter ways
sb.append("\n\n").append("*** WAYS ***");
for (Way way : mapReadResult.ways) {
if (way.geometryType != GeometryBuffer.GeometryType.POLY
|| !GeoPointUtils.contains(way.geoPoints[0], p)) {
continue;
}
sb.append("\n");
List<Tag> tags = way.tags;
for (Tag tag : tags) {
sb.append("\n").append(tag.key).append("=").append(tag.value);
}
}
AlertDialog.Builder builder = new AlertDialog.Builder(ReverseGeocodeActivity.this);
builder.setIcon(android.R.drawable.ic_menu_search);
builder.setTitle(R.string.dialog_reverse_geocoding_title);
builder.setMessage(sb);
builder.setPositiveButton(R.string.ok, null);
builder.show();
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import android.widget.Toast;
import org.oscim.layers.marker.MarkerItem;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicInteger;
public class RotateMarkerOverlayActivity extends MarkerOverlayActivity {
private Timer timer;
private int markerCount = 0;
private void itemEvent(final MarkerItem item) {
if (item.getMarker() == null) {
item.setMarker(mFocusMarker);
markerCount++;
final AtomicInteger rotValue = new AtomicInteger(0);
if (timer != null)
timer.cancel();
timer = new Timer();
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
float value = (float) (rotValue.incrementAndGet() * 10);
item.setRotation(value);
if (rotValue.get() > 36)
rotValue.set(0);
mMarkerLayer.update();
mMap.updateMap(true);
}
};
timer.schedule(timerTask, 1000, 1000);
} else {
item.setMarker(null);
markerCount--;
if (timer != null && markerCount == 0)
timer.cancel();
}
}
@Override
public boolean onItemSingleTapUp(int index, MarkerItem item) {
itemEvent(item);
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public boolean onItemLongPress(int index, MarkerItem item) {
itemEvent(item);
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
}

View File

@@ -1,7 +1,9 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
* Copyright 2017 nebular
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -20,56 +22,110 @@ package org.oscim.android.test;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
/**
* A simple start screen for the sample activities.
* Start screen for the sample activities.
*/
public class Samples extends Activity {
private Button createButton(Class<?> clazz) {
return this.createButton(clazz, null, null);
}
private Button createButton(final Class<?> clazz, String text, View.OnClickListener customListener) {
Button button = new Button(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
button.setAllCaps(false);
if (text == null) {
button.setText(clazz.getSimpleName());
} else {
button.setText(text);
}
if (customListener == null) {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Samples.this, clazz));
}
});
} else {
button.setOnClickListener(customListener);
}
return button;
}
private TextView createLabel(String text) {
TextView textView = new TextView(this);
textView.setGravity(Gravity.CENTER);
if (text == null) {
textView.setText("----------");
} else {
textView.setText(text);
}
return textView;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_samples);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.samples);
LinearLayout linearLayout = findViewById(R.id.samples);
linearLayout.addView(createButton(SimpleMapActivity.class));
linearLayout.addView(createButton(BitmapTileMapActivity.class));
linearLayout.addView(createButton(MapsforgeMapActivity.class));
linearLayout.addView(createButton(MapzenMvtMapActivity.class));
linearLayout.addView(createButton(MapzenGeojsonMapActivity.class));
linearLayout.addView(createButton(OpenMapTilesGeojsonMapActivity.class));
linearLayout.addView(createButton(GdxMapActivity.class));
linearLayout.addView(createLabel("Features"));
linearLayout.addView(createButton(null, "GraphHopper Routing", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/graphhopper/graphhopper/tree/master/android")));
}
}));
linearLayout.addView(createButton(PoiSearchActivity.class));
linearLayout.addView(createLabel("Vector Features"));
linearLayout.addView(createButton(MapsforgeStyleActivity.class));
linearLayout.addView(createButton(MapsforgePolyLabelActivity.class));
linearLayout.addView(createButton(AtlasThemeActivity.class));
linearLayout.addView(createButton(POTTextureActivity.class));
linearLayout.addView(createLabel("Raster Maps"));
linearLayout.addView(createButton(BitmapTileMapActivity.class));
linearLayout.addView(createLabel("Overlays"));
linearLayout.addView(createButton(MarkerOverlayActivity.class));
linearLayout.addView(createButton(RotateMarkerOverlayActivity.class));
linearLayout.addView(createButton(AtlasMarkerOverlayActivity.class));
linearLayout.addView(createButton(AtlasMultiTextureActivity.class));
linearLayout.addView(createButton(ClusterMarkerOverlayActivity.class));
linearLayout.addView(createButton(PathOverlayActivity.class));
linearLayout.addView(createButton(LineTexActivity.class));
linearLayout.addView(createButton(LayerGroupActivity.class));
linearLayout.addView(createButton(LocationActivity.class));
linearLayout.addView(createButton(ThemeStylerActivity.class));
linearLayout.addView(createButton(S3DBMapActivity.class));
linearLayout.addView(createButton(JeoIndoorMapActivity.class));
linearLayout.addView(createButton(OsmJsonMapActivity.class));
linearLayout.addView(createButton(VectorLayerMapActivity.class));
linearLayout.addView(createButton(LocationActivity.class));
linearLayout.addView(createLabel("User Interaction"));
linearLayout.addView(createButton(NewGesturesActivity.class));
linearLayout.addView(createButton(LayerGroupActivity.class));
linearLayout.addView(createLabel("Dual Map Views"));
linearLayout.addView(createButton(MultiMapActivity.class));
}
private Button createButton(final Class<?> clazz) {
return this.createButton(clazz, null);
}
private Button createButton(final Class<?> clazz, String text) {
Button button = new Button(this);
if (text == null) {
button.setText(clazz.getSimpleName());
} else {
button.setText(text);
}
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Samples.this, clazz));
}
});
return button;
linearLayout.addView(createLabel("Experiments"));
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
linearLayout.addView(createButton(OSciMapS3DBMapActivity.class));
linearLayout.addView(createButton(ThemeStylerActivity.class));
linearLayout.addView(createButton(JeoIndoorMapActivity.class));
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -19,7 +19,6 @@ package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.backend.CanvasAdapter;
import org.oscim.core.MapPosition;
import org.oscim.core.MercatorProjection;
import org.oscim.layers.GroupLayer;
@@ -43,12 +42,16 @@ public class SimpleMapActivity extends BaseMapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
createLayers();
}
void createLayers() {
GroupLayer groupLayer = new GroupLayer(mMap);
groupLayer.layers.add(new BuildingLayer(mMap, mBaseLayer));
groupLayer.layers.add(new LabelLayer(mMap, mBaseLayer));
mMap.layers().add(groupLayer);
mapScaleBar = new DefaultMapScaleBar(mMap, CanvasAdapter.dpi / 160);
mapScaleBar = new DefaultMapScaleBar(mMap);
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
@@ -57,7 +60,7 @@ public class SimpleMapActivity extends BaseMapActivity {
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mapScaleBar);
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
renderer.setOffset(5 * CanvasAdapter.dpi / 160, 0);
renderer.setOffset(5 * getResources().getDisplayMetrics().density, 0);
mMap.layers().add(mapScaleBarLayer);
mMap.setTheme(VtmThemes.DEFAULT);
@@ -65,7 +68,8 @@ public class SimpleMapActivity extends BaseMapActivity {
@Override
protected void onDestroy() {
mapScaleBar.destroy();
if (mapScaleBar != null)
mapScaleBar.destroy();
super.onDestroy();
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -20,24 +20,16 @@ package org.oscim.android.test;
import android.os.Bundle;
import org.oscim.backend.canvas.Color;
import org.oscim.layers.TileGridLayer;
import org.oscim.layers.vector.VectorLayer;
import org.oscim.layers.vector.geometries.PointDrawable;
import org.oscim.layers.vector.geometries.Style;
import org.oscim.utils.ColorUtil;
import static org.oscim.tiling.source.bitmap.DefaultSources.STAMEN_TONER;
public class VectorLayerMapActivity extends BitmapTileMapActivity {
public VectorLayerMapActivity() {
super(STAMEN_TONER.build());
}
public class VectorLayerMapActivity extends SimpleMapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBitmapLayer.tileRenderer().setBitmapAlpha(0.5f);
VectorLayer vectorLayer = new VectorLayer(mMap);
@@ -95,7 +87,6 @@ public class VectorLayerMapActivity extends BitmapTileMapActivity {
vectorLayer.update();
mMap.layers().add(vectorLayer);
mMap.layers().add(new TileGridLayer(mMap, 0xff222222, 1.2f, 1));
}
@Override

View File

@@ -1,30 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.oscim.gdx"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="UTF-8"?>
<manifest package="org.oscim.gdx" />

View File

@@ -1,11 +1,8 @@
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
dependencies {
compile project(':vtm-android')
compile project(':vtm-gdx')
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
compile 'com.noveogroup.android:android-logger:1.3.6'
api project(':vtm')
}
android {
@@ -21,6 +18,7 @@ android {
versionCode versionCode()
versionName versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {
@@ -28,14 +26,6 @@ android {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src', 'assets']
renderscript.srcDirs = ['src', 'assets']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
file('natives').eachDir() { dir ->
jniLibs.srcDirs += "${dir.path}/lib"
jniLibs.srcDirs += "${rootDir}/vtm-android/natives/${dir.name}/lib"
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
@@ -44,52 +34,21 @@ android {
lintOptions { abortOnError false }
}
android.applicationVariants.all { variant ->
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals("debug")) {
print "Skipping debug jar"
return; // Skip debug builds.
}
if (name == "debug")
return
def jar = project.tasks.create "jar${name.capitalize()}", Jar
jar.dependsOn variant.javaCompile
jar.from variant.javaCompile.destinationDir
jar.exclude 'android-logger.properties'
artifacts.add('archives', jar);
jar.dependsOn variant.javaCompiler
jar.from variant.javaCompiler.destinationDir
artifacts.add('archives', jar)
file('natives').eachDir() { dir ->
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
nativesJar.classifier = "natives-${dir.name}"
nativesJar.from(dir.path)
artifacts.add('archives', nativesJar);
}
def fatJar = project.tasks.create "fatJar${name.capitalize()}", Jar
fatJar.classifier = 'jar-with-dependencies'
fatJar.dependsOn variant.javaCompile
fatJar.from variant.javaCompile.destinationDir
fatJar.from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
file('natives').eachDir() { dir ->
fatJar.from(dir.path)
fatJar.from("${rootProject.projectDir}/vtm-android/natives/${dir.name}")
}
fatJar.exclude 'android-logger.properties'
artifacts.add('archives', fatJar);
}
afterEvaluate {
configurations.archives.artifacts.removeAll { it.file =~ 'apk' }
}
task run(dependsOn: 'installDebug') {
doFirst {
println(">> adb run...")
String adb = System.getenv()['ANDROID_HOME'] + '/platform-tools/adb'
String cmd = "${adb} shell am start -n org.oscim.gdx/.MainActivity"
def proc = cmd.execute()
proc.in.eachLine { line -> println line }
proc.err.eachLine { line -> System.err.println('ERROR: ' + line) }
proc.waitFor()
artifacts.add('archives', nativesJar)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
</LinearLayout>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">VTM GDX</string>
</resources>

View File

@@ -1 +0,0 @@
root=DEBUG:%logger

View File

@@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
dependencies {
compile project(':vtm')
compile 'com.caverock:androidsvg:1.2.2-beta-1'
api project(':vtm')
api 'com.caverock:androidsvg:1.2.2-beta-1'
}
android {
compileSdkVersion androidCompileSdk()
buildToolsVersion = "$androidBuildVersionTools"
buildToolsVersion "$androidBuildVersionTools"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
@@ -19,6 +19,7 @@ android {
versionCode versionCode()
versionName versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {
@@ -26,8 +27,6 @@ android {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
@@ -38,32 +37,20 @@ android {
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals("debug")) {
print "Skipping debug jar"
return; // Skip debug builds.
}
if (name == "debug")
return
def jar = project.tasks.create "jar${name.capitalize()}", Jar
jar.dependsOn variant.javaCompile
jar.from variant.javaCompile.destinationDir
artifacts.add('archives', jar);
jar.dependsOn variant.javaCompiler
jar.from variant.javaCompiler.destinationDir
artifacts.add('archives', jar)
file('natives').eachDir() { dir ->
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
nativesJar.classifier = "natives-${dir.name}"
nativesJar.from(dir.path)
artifacts.add('archives', nativesJar);
artifacts.add('archives', nativesJar)
}
def fatJar = project.tasks.create "fatJar${name.capitalize()}", Jar
fatJar.classifier = 'jar-with-dependencies'
fatJar.dependsOn variant.javaCompile
fatJar.from variant.javaCompile.destinationDir
fatJar.from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
file('natives').eachDir() { dir ->
fatJar.from(dir.path)
}
artifacts.add('archives', fatJar);
}
if (project.hasProperty("SONATYPE_USERNAME")) {

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2012 Hannes Janetzek
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -30,7 +31,9 @@ import org.oscim.android.input.AndroidMotionEvent;
import org.oscim.android.input.GestureHandler;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.GLAdapter;
import org.oscim.core.Tile;
import org.oscim.map.Map;
import org.oscim.utils.Parameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,13 +51,13 @@ public class MapView extends GLSurfaceView {
static final Logger log = LoggerFactory.getLogger(MapView.class);
static {
private static void init() {
System.loadLibrary("vtm-jni");
}
protected final AndroidMap mMap;
protected final GestureDetector mGestureDetector;
protected final AndroidMotionEvent mMotionEvent;
protected AndroidMap mMap;
protected GestureDetector mGestureDetector;
protected AndroidMotionEvent mMotionEvent;
public MapView(Context context) {
this(context, null);
@@ -63,19 +66,26 @@ public class MapView extends GLSurfaceView {
public MapView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
if (isInEditMode())
return;
init();
/* Not sure if this makes sense */
this.setWillNotDraw(true);
this.setClickable(true);
this.setFocusable(true);
this.setFocusableInTouchMode(true);
/* Setup android backedn */
/* Setup android backend */
AndroidGraphics.init();
AndroidAssets.init(context);
GLAdapter.init(new AndroidGL());
DisplayMetrics metrics = getResources().getDisplayMetrics();
CanvasAdapter.dpi = (int) Math.max(metrics.xdpi, metrics.ydpi);
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
if (!Parameters.CUSTOM_TILE_SIZE)
Tile.SIZE = Tile.calculateTileSize();
/* Initialize the Map */
mMap = new AndroidMap(this);
@@ -94,15 +104,17 @@ public class MapView extends GLSurfaceView {
mMap.clearMap();
mMap.updateMap(false);
GestureHandler gestureHandler = new GestureHandler(mMap);
mGestureDetector = new GestureDetector(context, gestureHandler);
mGestureDetector.setOnDoubleTapListener(gestureHandler);
if (!Parameters.MAP_EVENT_LAYER2) {
GestureHandler gestureHandler = new GestureHandler(mMap);
mGestureDetector = new GestureDetector(context, gestureHandler);
mGestureDetector.setOnDoubleTapListener(gestureHandler);
}
mMotionEvent = new AndroidMotionEvent();
}
public void onStop() {
public void onDestroy() {
mMap.destroy();
}
public void onPause() {
@@ -116,14 +128,16 @@ public class MapView extends GLSurfaceView {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(android.view.MotionEvent motionEvent) {
if (!isClickable())
return false;
if (mGestureDetector.onTouchEvent(motionEvent))
return true;
if (mGestureDetector != null) {
if (mGestureDetector.onTouchEvent(motionEvent))
return true;
}
mMap.input.fire(null, mMotionEvent.wrap(motionEvent));
mMotionEvent.recycle();
return true;
}
@@ -133,8 +147,10 @@ public class MapView extends GLSurfaceView {
super.onSizeChanged(width, height, oldWidth, oldHeight);
if (width > 0 && height > 0)
mMap.viewport().setScreenSize(width, height);
if (!isInEditMode()) {
if (width > 0 && height > 0)
mMap.viewport().setScreenSize(width, height);
}
}
public Map map() {

View File

@@ -1,6 +1,8 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 nebular
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -17,7 +19,9 @@
*/
package org.oscim.android.canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.RectF;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.backend.canvas.Canvas;
@@ -62,13 +66,34 @@ public class AndroidCanvas implements Canvas {
}
@Override
public void drawLine(int x1, int y1, int x2, int y2, Paint paint) {
public void drawBitmapScaled(Bitmap bitmap) {
android.graphics.Bitmap scaledBitmap = android.graphics.Bitmap.createScaledBitmap(
((AndroidBitmap) bitmap).mBitmap, canvas.getWidth(), canvas.getHeight(), true);
canvas.drawBitmap(scaledBitmap, 0, 0, null);
scaledBitmap.recycle();
}
@Override
public void drawCircle(float x, float y, float radius, Paint paint) {
canvas.drawCircle(x, y, radius, ((AndroidPaint) paint).mPaint);
}
@Override
public void drawLine(float x1, float y1, float x2, float y2, Paint paint) {
canvas.drawLine(x1, y1, x2, y2, ((AndroidPaint) paint).mPaint);
}
@Override
public void fillColor(int color) {
canvas.drawColor(color, PorterDuff.Mode.CLEAR);
canvas.drawColor(color, color == Color.TRANSPARENT ? PorterDuff.Mode.CLEAR : PorterDuff.Mode.SRC_OVER);
}
@Override
public void fillRectangle(float x, float y, float width, float height, int color) {
RectF rect = new RectF(x, y, x + width, y + height);
android.graphics.Paint paint = new android.graphics.Paint();
paint.setColor(color);
canvas.drawRect(rect, paint);
}
@Override

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 Longri
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -23,6 +24,7 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.Platform;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.backend.canvas.Canvas;
import org.oscim.backend.canvas.Paint;
@@ -36,6 +38,7 @@ public final class AndroidGraphics extends CanvasAdapter {
public static void init() {
CanvasAdapter.init(new AndroidGraphics());
CanvasAdapter.platform = Platform.ANDROID;
}
public static android.graphics.Paint getAndroidPaint(Paint paint) {
@@ -56,23 +59,13 @@ public final class AndroidGraphics extends CanvasAdapter {
}
@Override
public Bitmap decodeSvgBitmapImpl(InputStream inputStream) {
try {
return new AndroidSvgBitmap(inputStream);
} catch (IOException e) {
e.printStackTrace();
return null;
}
public Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
return new AndroidSvgBitmap(inputStream, width, height, percent);
}
@Override
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src) {
try {
return createBitmap(relativePathPrefix, src);
} catch (IOException e) {
e.printStackTrace();
}
return null;
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) throws IOException {
return createBitmap(relativePathPrefix, src, width, height, percent);
}
@Override
@@ -109,7 +102,7 @@ public final class AndroidGraphics extends CanvasAdapter {
}
public static Bitmap drawableToBitmap(Resources res, int resId) {
return new AndroidBitmap(res.openRawResource(resId));
return drawableToBitmap(res.getDrawable(resId));
}
/**

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 nebular
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -100,8 +101,7 @@ class AndroidPaint implements Paint {
@Override
public void setTextAlign(Align align) {
// Align text in text layer
//mPaint.setTextAlign(android.graphics.Paint.Align.valueOf(align.name()));
mPaint.setTextAlign(android.graphics.Paint.Align.valueOf(align.name()));
}
@Override
@@ -134,6 +134,21 @@ class AndroidPaint implements Paint {
return Math.abs(fm.bottom);
}
@Override
public float getStrokeWidth() {
return mPaint.getStrokeWidth();
}
@Override
public Style getStyle() {
switch (mPaint.getStyle()) {
case STROKE:
return Style.STROKE;
default:
return Style.FILL;
}
}
@Override
public float getTextHeight(String text) {
mPaint.getTextBounds(text, 0, text.length(), rect);

View File

@@ -1,5 +1,7 @@
/*
* Copyright 2016 devemux86
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2013-2014 Ludwig M Brinckmann
* Copyright 2014-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -74,13 +76,13 @@ public class AndroidSvgBitmap extends AndroidBitmap {
}
}
private static android.graphics.Bitmap getResourceBitmapImpl(InputStream inputStream) throws IOException {
private static android.graphics.Bitmap getResourceBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
synchronized (SVG.getVersion()) {
return getResourceBitmap(inputStream, CanvasAdapter.dpi / 160, DEFAULT_SIZE, 0, 0, 100);
return getResourceBitmap(inputStream, CanvasAdapter.getScale(), DEFAULT_SIZE, width, height, percent);
}
}
public AndroidSvgBitmap(InputStream inputStream) throws IOException {
super(getResourceBitmapImpl(inputStream));
public AndroidSvgBitmap(InputStream inputStream, int width, int height, int percent) throws IOException {
super(getResourceBitmapImpl(inputStream, width, height, percent));
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 Andrey Novikov
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -20,10 +21,10 @@ import org.oscim.event.MotionEvent;
public class AndroidMotionEvent extends MotionEvent {
android.view.MotionEvent mEvent;
private android.view.MotionEvent mEvent;
public MotionEvent wrap(android.view.MotionEvent e) {
mEvent = e;
mEvent = android.view.MotionEvent.obtain(e);
return this;
}
@@ -57,6 +58,16 @@ public class AndroidMotionEvent extends MotionEvent {
return mEvent.getPointerCount();
}
@Override
public MotionEvent copy() {
return new AndroidMotionEvent().wrap(mEvent);
}
@Override
public void recycle() {
mEvent.recycle();
}
@Override
public long getTime() {
return mEvent.getEventTime();

View File

@@ -1,3 +1,20 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.input;
import android.view.GestureDetector.OnDoubleTapListener;
@@ -11,16 +28,18 @@ public class GestureHandler implements OnGestureListener, OnDoubleTapListener {
private final AndroidMotionEvent mMotionEvent;
private final Map mMap;
// Quick scale (double tap + swipe)
protected boolean quickScale;
public GestureHandler(Map map) {
mMotionEvent = new AndroidMotionEvent();
mMap = map;
}
/* GesturListener */
/* OnGestureListener */
@Override
public boolean onSingleTapUp(MotionEvent e) {
// return mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
return false;
}
@@ -35,6 +54,10 @@ public class GestureHandler implements OnGestureListener, OnDoubleTapListener {
@Override
public void onLongPress(MotionEvent e) {
// Quick scale (no long press)
if (quickScale)
return;
mMap.handleGesture(Gesture.LONG_PRESS, mMotionEvent.wrap(e));
}
@@ -45,10 +68,13 @@ public class GestureHandler implements OnGestureListener, OnDoubleTapListener {
@Override
public boolean onDown(MotionEvent e) {
quickScale = false;
return mMap.handleGesture(Gesture.PRESS, mMotionEvent.wrap(e));
}
/* DoubleTapListener */
/* OnDoubleTapListener */
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
return mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
@@ -56,6 +82,11 @@ public class GestureHandler implements OnGestureListener, OnDoubleTapListener {
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
int action = e.getActionMasked();
// Quick scale
quickScale = (action == MotionEvent.ACTION_MOVE);
return false;
}

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
* Copyright 2017 Andrey Novikov
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -15,11 +16,12 @@
*/
package org.oscim.android.theme;
import android.content.Context;
import android.content.res.AssetManager;
import android.text.TextUtils;
import org.oscim.theme.IRenderTheme.ThemeException;
import org.oscim.theme.ThemeFile;
import org.oscim.theme.ThemeUtils;
import org.oscim.theme.XmlRenderThemeMenuCallback;
import org.oscim.utils.Utils;
@@ -33,36 +35,33 @@ import java.io.InputStream;
public class AssetsRenderTheme implements ThemeFile {
private static final long serialVersionUID = 1L;
private final InputStream mInputStream;
private final XmlRenderThemeMenuCallback mMenuCallback;
private final AssetManager mAssetManager;
private final String mFileName;
private XmlRenderThemeMenuCallback mMenuCallback;
private final String mRelativePathPrefix;
/**
* @param context the Android context.
* @param assetManager the Android asset manager.
* @param relativePathPrefix the prefix for all relative resource paths.
* @param fileName the path to the XML render theme file.
* @throws ThemeException if an error occurs while reading the render theme XML.
*/
public AssetsRenderTheme(Context context, String relativePathPrefix, String fileName) throws ThemeException {
this(context, relativePathPrefix, fileName, null);
public AssetsRenderTheme(AssetManager assetManager, String relativePathPrefix, String fileName) throws ThemeException {
this(assetManager, relativePathPrefix, fileName, null);
}
/**
* @param context the Android context.
* @param assetManager the Android asset manager.
* @param relativePathPrefix the prefix for all relative resource paths.
* @param fileName the path to the XML render theme file.
* @param menuCallback the interface callback to create a settings menu on the fly.
* @throws ThemeException if an error occurs while reading the render theme XML.
*/
public AssetsRenderTheme(Context context, String relativePathPrefix, String fileName, XmlRenderThemeMenuCallback menuCallback) throws ThemeException {
public AssetsRenderTheme(AssetManager assetManager, String relativePathPrefix, String fileName, XmlRenderThemeMenuCallback menuCallback) throws ThemeException {
mAssetManager = assetManager;
mRelativePathPrefix = relativePathPrefix;
mFileName = fileName;
mMenuCallback = menuCallback;
try {
mInputStream = context.getAssets().open((TextUtils.isEmpty(mRelativePathPrefix) ? "" : mRelativePathPrefix) + fileName);
} catch (IOException e) {
throw new ThemeException(e.getMessage());
}
}
@Override
@@ -73,7 +72,7 @@ public class AssetsRenderTheme implements ThemeFile {
return false;
}
AssetsRenderTheme other = (AssetsRenderTheme) obj;
if (mInputStream != other.mInputStream) {
if (getRenderThemeAsStream() != other.getRenderThemeAsStream()) {
return false;
}
if (!Utils.equals(mRelativePathPrefix, other.mRelativePathPrefix)) {
@@ -94,6 +93,20 @@ public class AssetsRenderTheme implements ThemeFile {
@Override
public InputStream getRenderThemeAsStream() throws ThemeException {
return mInputStream;
try {
return mAssetManager.open((TextUtils.isEmpty(mRelativePathPrefix) ? "" : mRelativePathPrefix) + mFileName);
} catch (IOException e) {
throw new ThemeException(e.getMessage());
}
}
@Override
public boolean isMapsforgeTheme() {
return ThemeUtils.isMapsforgeTheme(this);
}
@Override
public void setMenuCallback(XmlRenderThemeMenuCallback menuCallback) {
mMenuCallback = menuCallback;
}
}

View File

@@ -13,10 +13,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="22" />
<application
android:name=".App"
android:allowBackup="true"

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'
dependencies {
compile project(':vtm-android')
compile project(':vtm-themes')
compile project(':vtm-extras')
compile 'com.noveogroup.android:android-logger:1.3.6'
compile 'com.squareup.okhttp:okhttp:2.6.0'
implementation project(':vtm-android')
implementation project(':vtm-extras')
implementation project(':vtm-themes')
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation "org.slf4j:slf4j-android:$slf4jVersion"
}
android {
@@ -21,6 +21,7 @@ android {
versionCode versionCode()
versionName versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {

View File

@@ -1 +0,0 @@
root=DEBUG:%logger

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2013 Hannes Janetzek
* Copyright 2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -60,14 +61,12 @@ public abstract class MapActivity extends Activity {
@Override
protected void onDestroy() {
mMapView.onDestroy();
super.onDestroy();
mMap.destroy();
}
@Override
protected void onPause() {
super.onPause();
Editor editor = getSharedPreferences(PREFERENCES_FILE, MODE_PRIVATE).edit();
editor.clear();
@@ -82,7 +81,9 @@ public abstract class MapActivity extends Activity {
editor.putInt(KEY_LONGITUDE, geoPoint.longitudeE6);
editor.putFloat(KEY_MAP_SCALE, (float) mapPosition.scale);
editor.commit();
editor.apply();
super.onPause();
}
@Override
@@ -93,8 +94,8 @@ public abstract class MapActivity extends Activity {
@Override
protected void onStop() {
super.onStop();
mMapView.onPause();
super.onStop();
}
/**

View File

@@ -148,13 +148,13 @@ public class MapLayers {
}
void enableGridOverlay(boolean enable) {
void enableGridOverlay(Context context, boolean enable) {
if (mGridEnabled == enable)
return;
if (enable) {
if (mGridOverlay == null)
mGridOverlay = new TileGridLayer(App.map);
mGridOverlay = new TileGridLayer(App.map, context.getResources().getDisplayMetrics().density);
App.map.layers().add(mGridOverlay);
} else {

View File

@@ -1,6 +1,6 @@
/* Copyright 2010, 2011, 2012 mapsforge.org
* Copyright 2012 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -40,7 +40,6 @@ import org.oscim.app.location.LocationDialog;
import org.oscim.app.location.LocationHandler;
import org.oscim.app.preferences.EditPreferences;
import org.oscim.core.GeoPoint;
import org.oscim.core.Tile;
import org.oscim.overlay.DistanceTouchOverlay;
import org.osmdroid.location.POI;
import org.osmdroid.overlays.MapEventsReceiver;
@@ -74,7 +73,6 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
setContentView(R.layout.activity_tilemap);
App.view = (MapView) findViewById(R.id.mapView);
registerMapView(App.view);
@@ -205,7 +203,7 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
break;
case R.id.menu_layer_grid:
mMapLayers.enableGridOverlay(!mMapLayers.isGridEnabled());
mMapLayers.enableGridOverlay(this, !mMapLayers.isGridEnabled());
mMap.updateMap(true);
break;

View File

@@ -1,7 +1,7 @@
/*
* Copyright 2013 Ahmad Saleem
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -85,6 +85,11 @@ public class Compass extends Layer implements SensorEventListener, Map.UpdateLis
setEnabled(false);
}
@Override
public boolean hasRotation() {
return true;
}
@Override
public synchronized float getRotation() {
return mCurRotation;

View File

@@ -33,6 +33,7 @@ class LocationLayerImpl extends LocationLayer {
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
mCompass.setEnabled(enabled);
if (mCompass != null)
mCompass.setEnabled(enabled);
}
}

View File

@@ -2,25 +2,26 @@ package org.osmdroid.utils;
import android.util.Log;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.OkHttpClient.Builder;
import okhttp3.Request;
import okhttp3.Response;
/**
* A "very very simple to use" class for performing http get and post requests.
* So many ways to do that, and potential subtle issues.
* If complexity should be added to handle even more issues, complexity should be put here and only here.
* <p/>
* <p>
* Typical usage:
* <pre>HttpConnection connection = new HttpConnection();
* connection.doGet("http://www.google.com");
* InputStream stream = connection.getStream();
* if (stream != null) {
* //use this stream, for buffer reading, or XML SAX parsing, or whatever...
* //use this stream, for buffer reading, or XML SAX parsing, or whatever...
* }
* connection.close();</pre>
*/
@@ -35,9 +36,14 @@ public class HttpConnection {
private static OkHttpClient getOkHttpClient() {
if (client == null) {
client = new OkHttpClient();
Builder b = new Builder();
b.connectTimeout(TIMEOUT_CONNECTION, TimeUnit.MILLISECONDS);
b.readTimeout(TIMEOUT_SOCKET, TimeUnit.MILLISECONDS);
client = b.build();
/*
client.setConnectTimeout(TIMEOUT_CONNECTION, TimeUnit.MILLISECONDS);
client.setReadTimeout(TIMEOUT_SOCKET, TimeUnit.MILLISECONDS);
*/
}
return client;
}
@@ -73,15 +79,10 @@ public class HttpConnection {
* @return the opened InputStream, or null if creation failed for any reason.
*/
public InputStream getStream() {
try {
if (response == null)
return null;
stream = response.body().byteStream();
return stream;
} catch (IOException e) {
e.printStackTrace();
if (response == null)
return null;
}
stream = response.body().byteStream();
return stream;
}
/**

View File

@@ -1,14 +1,10 @@
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
dependencies {
compile project(':vtm-gdx')
file('natives').eachDir() { dir ->
compile files(dir.path)
}
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile 'com.kitfox.svg:svg-salamander:1.0'
api project(':vtm-gdx')
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
}
sourceSets {
@@ -28,21 +24,6 @@ file('natives').eachDir() { dir ->
}
}
task fatJar(type: Jar, dependsOn: classes) {
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
// Natives come from compile configuration
/*file('natives').eachDir() { dir ->
fatJar.from(dir.path)
}*/
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
with jar
}
artifacts {
archives fatJar
}
if (project.hasProperty("SONATYPE_USERNAME")) {
afterEvaluate {
project.apply from: "${rootProject.projectDir}/deploy.gradle"

Some files were not shown because too many files have changed in this diff Show More