Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49ded685b4 | ||
|
|
9b14865bf3 | ||
|
|
abac84e82a | ||
|
|
0367507dae | ||
|
|
9977061680 | ||
|
|
3cae38040c | ||
|
|
97cdfa119d | ||
|
|
641db3ade0 | ||
|
|
bddf2443b6 | ||
|
|
1404d21838 | ||
|
|
95bbc5ea3e | ||
|
|
f8776ffe5f | ||
|
|
bc1dee49a4 | ||
|
|
d81a6309bf | ||
|
|
9a6da018a9 | ||
|
|
8d639499ba | ||
|
|
a5d7a8f6b0 | ||
|
|
577f1520d2 | ||
|
|
c938533943 | ||
|
|
e3b137e3c4 | ||
|
|
72b72b8029 | ||
|
|
ba68b79e86 |
36
.travis.yml
36
.travis.yml
@@ -1,28 +1,32 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: android
|
language: android
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
android:
|
|
||||||
components:
|
|
||||||
- tools
|
|
||||||
- platform-tools
|
|
||||||
- tools
|
|
||||||
- build-tools-27.0.1
|
|
||||||
- android-27
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- GRADLE_OPTS="-Xmx2048m"
|
- ANDROID=27
|
||||||
- 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=
|
- ANDROID_BUILD_TOOLS=27.0.3
|
||||||
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
|
- 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:
|
script:
|
||||||
- ./gradlew clean build
|
- ./gradlew clean build
|
||||||
after_success:
|
after_success:
|
||||||
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||||
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
||||||
fi
|
fi
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
- secure: fOInp4SGBqiIMgnsGceQTa0SuFLaAoxAF15W0crhuljGlqSgnbnBjh0xFEF4P5+q3VT3DgDZs53GVVo6S9gEl8AWJy84KGuUX1M/CQKUQC4bwNXJdHfY3MIy6D50da6UfwWeNS4ienKh2Rj6w2TapN9M8C9nJJZk9aJFc9NWZmWTVboHZd4oUDeeRBJ6KSk1Ay7L/mmxv4cMCXaW7pPJixvUFESKNYgK4KAN3zYpym2UijrQ8zf7OVcYnTorcAuXUZDk8EvwdHl3rIAdlbVqvyZ8rmoQ2Da/Q2VlWUL/HrHUVJtCPZ+T+dNUag4a8joIDqWKwcyk76PElmgft3azb7GERb+bkZz1ToQc2IvuOeUk2SsuXWZugoEQImKWl/yWeirWBLrwzieaVh4j04dMSn/Npc1yL5kjX9EuiM6MFHdYPianMpvhFiaYKihjzW0GPV6sfuY7xS8cA9L9DjAsXoHIXIxc/+hRA+bpPUl+qMaQdGjJmNJJ2VPFnOY0XCsDDQDIVa3nZOA6aXMUG2c4H26RJZPe7uvfRiuL86n3KAmkoXSwne9t8WYMgl89LMsU5XxjBvwz2Qa1HqG09tVs6nhB23easrhEYEf/ZsGg0DIIL1FImUHj+wUUfZXeyFmbiE6lD/i2+3a5DqzZGHbXUDCoUIagObMf8fe2z5+0K/Q=
|
- 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_success: always
|
||||||
on_failure: always
|
on_failure: always
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ allprojects {
|
|||||||
version = 'master-SNAPSHOT'
|
version = 'master-SNAPSHOT'
|
||||||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
||||||
|
|
||||||
ext.androidBuildVersionTools = "27.0.1"
|
ext.androidBuildVersionTools = "27.0.3"
|
||||||
ext.gdxVersion = "1.9.7"
|
ext.gdxVersion = "1.9.7"
|
||||||
ext.gwtVersion = "2.8.0"
|
ext.gwtVersion = "2.8.0"
|
||||||
ext.slf4jVersion = "1.7.25"
|
ext.slf4jVersion = "1.7.25"
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version 0.9.1 (2017-12-29)
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
|
||||||
## Version 0.9.0 (2017-12-03)
|
## Version 0.9.0 (2017-12-03)
|
||||||
|
|
||||||
- Mapsforge maps **v5 beta** support [#429](https://github.com/mapsforge/vtm/issues/429)
|
- Mapsforge maps **v5 beta** support [#429](https://github.com/mapsforge/vtm/issues/429)
|
||||||
|
|||||||
@@ -67,6 +67,32 @@ implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
|||||||
implementation 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
|
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
|
## Snapshots
|
||||||
|
|
||||||
We publish SNAPSHOT builds to Sonatype OSS Repository Hosting.
|
We publish SNAPSHOT builds to Sonatype OSS Repository Hosting.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- [AndroidMaps](http://www.androidmaps.co.uk/)
|
- [AndroidMaps](http://www.androidmaps.co.uk/)
|
||||||
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
|
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
|
||||||
|
- [Kurviger](https://offline-maps.kurviger.de/)
|
||||||
- [Locusvectormaps](http://www.locusvectormaps.com)
|
- [Locusvectormaps](http://www.locusvectormaps.com)
|
||||||
- [Mapsforge](http://download.mapsforge.org/)
|
- [Mapsforge](http://download.mapsforge.org/)
|
||||||
- [OpenAndroMaps](http://www.openandromaps.org/en/)
|
- [OpenAndroMaps](http://www.openandromaps.org/en/)
|
||||||
|
|||||||
@@ -85,6 +85,9 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".OpenMapTilesGeojsonMapActivity"
|
android:name=".OpenMapTilesGeojsonMapActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".OSciMapS3DBMapActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".PathOverlayActivity"
|
android:name=".PathOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -103,9 +106,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".RotateMarkerOverlayActivity"
|
android:name=".RotateMarkerOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
|
||||||
android:name=".S3DBMapActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".SimpleMapActivity"
|
android:name=".SimpleMapActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
|||||||
@@ -70,14 +70,6 @@ android {
|
|||||||
exclude 'META-INF/LICENSE'
|
exclude 'META-INF/LICENSE'
|
||||||
exclude 'META-INF/NOTICE'
|
exclude 'META-INF/NOTICE'
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
all {
|
|
||||||
minifyEnabled true
|
|
||||||
useProguard false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task run(dependsOn: 'installDebug') {
|
task run(dependsOn: 'installDebug') {
|
||||||
|
|||||||
10
vtm-android-example/proguard-rules.pro
vendored
10
vtm-android-example/proguard-rules.pro
vendored
@@ -1,10 +0,0 @@
|
|||||||
-keep class com.** { *; }
|
|
||||||
-dontwarn com.**
|
|
||||||
-keep class jsqlite.** { *; }
|
|
||||||
-dontwarn jsqlite.**
|
|
||||||
-keep class okhttp3.** { *; }
|
|
||||||
-dontwarn okhttp3.**
|
|
||||||
-keep class okio.** { *; }
|
|
||||||
-dontwarn okio.**
|
|
||||||
-keep class org.** { *; }
|
|
||||||
-dontwarn org.**
|
|
||||||
@@ -30,6 +30,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -46,7 +48,10 @@ public class AtlasMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -50,7 +52,10 @@ public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.oscim.layers.TileGridLayer;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -53,7 +54,9 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
mTileSource = new OSciMap4TileSource();
|
mTileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
if (USE_CACHE) {
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
mCache = new TileCache(this, null, "tile.db");
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import org.oscim.layers.tile.buildings.BuildingLayer;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -46,7 +48,10 @@ public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.oscim.gdx.AndroidGL;
|
|||||||
import org.oscim.gdx.GdxAssets;
|
import org.oscim.gdx.GdxAssets;
|
||||||
import org.oscim.gdx.GdxMap;
|
import org.oscim.gdx.GdxMap;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class GdxMapActivity extends AndroidApplication {
|
public class GdxMapActivity extends AndroidApplication {
|
||||||
@@ -60,7 +61,9 @@ public class GdxMapActivity extends AndroidApplication {
|
|||||||
class GdxMapAndroid extends GdxMap {
|
class GdxMapAndroid extends GdxMap {
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
TileSource ts = new OSciMap4TileSource();
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
|
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ import org.oscim.layers.tile.vector.VectorTileLayer;
|
|||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -53,7 +55,10 @@ public class MarkerOverlayActivity extends SimpleMapActivity
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import org.oscim.layers.tile.vector.VectorTileLayer;
|
|||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class MultiMapActivity extends Activity {
|
public class MultiMapActivity extends Activity {
|
||||||
@@ -43,7 +45,10 @@ public class MultiMapActivity extends Activity {
|
|||||||
mMapView1 = (MapView) findViewById(R.id.mapView1);
|
mMapView1 = (MapView) findViewById(R.id.mapView1);
|
||||||
Map map1 = mMapView1.map();
|
Map map1 = mMapView1.map();
|
||||||
mPrefs1 = new MapPreferences(MultiMapActivity.class.getName() + "1", this);
|
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 BuildingLayer(map1, baseLayer1));
|
||||||
map1.layers().add(new LabelLayer(map1, baseLayer1));
|
map1.layers().add(new LabelLayer(map1, baseLayer1));
|
||||||
map1.setTheme(VtmThemes.DEFAULT);
|
map1.setTheme(VtmThemes.DEFAULT);
|
||||||
@@ -52,7 +57,10 @@ public class MultiMapActivity extends Activity {
|
|||||||
mMapView2 = (MapView) findViewById(R.id.mapView2);
|
mMapView2 = (MapView) findViewById(R.id.mapView2);
|
||||||
Map map2 = mMapView2.map();
|
Map map2 = mMapView2.map();
|
||||||
mPrefs2 = new MapPreferences(MultiMapActivity.class.getName() + "2", this);
|
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 BuildingLayer(map2, baseLayer2));
|
||||||
map2.layers().add(new LabelLayer(map2, baseLayer2));
|
map2.layers().add(new LabelLayer(map2, baseLayer2));
|
||||||
map2.setTheme(VtmThemes.DEFAULT);
|
map2.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* 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.android.cache.TileCache;
|
||||||
import org.oscim.layers.tile.TileLayer;
|
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.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class S3DBMapActivity extends BaseMapActivity {
|
public class OSciMapS3DBMapActivity extends BaseMapActivity {
|
||||||
|
|
||||||
TileCache mS3dbCache;
|
TileCache mS3dbCache;
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ public class S3DBMapActivity extends BaseMapActivity {
|
|||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
TileSource ts = OSciMap4TileSource.builder()
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.url("http://opensciencemap.org/tiles/s3db")
|
.url("http://opensciencemap.org/tiles/s3db")
|
||||||
.zoomMin(16)
|
.zoomMin(16)
|
||||||
.zoomMax(16)
|
.zoomMax(16)
|
||||||
@@ -47,7 +49,7 @@ public class S3DBMapActivity extends BaseMapActivity {
|
|||||||
mS3dbCache.setCacheSize(512 * (1 << 10));
|
mS3dbCache.setCacheSize(512 * (1 << 10));
|
||||||
ts.setCache(mS3dbCache);
|
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(tl);
|
||||||
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ public class Samples extends Activity {
|
|||||||
|
|
||||||
linearLayout.addView(createLabel("Experiments"));
|
linearLayout.addView(createLabel("Experiments"));
|
||||||
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
||||||
linearLayout.addView(createButton(S3DBMapActivity.class));
|
linearLayout.addView(createButton(OSciMapS3DBMapActivity.class));
|
||||||
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
||||||
linearLayout.addView(createButton(JeoIndoorMapActivity.class));
|
linearLayout.addView(createButton(JeoIndoorMapActivity.class));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,8 +269,8 @@ public class GeoJsonTileDecoder implements ITileDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeLastPoint() {
|
private void removeLastPoint() {
|
||||||
mMapElement.pointPos -= 2;
|
mMapElement.pointNextPos -= 2;
|
||||||
mMapElement.index[mMapElement.indexPos] -= 2;
|
mMapElement.index[mMapElement.indexCurrentPos] -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseLineString(JsonParser jp)
|
private void parseLineString(JsonParser jp)
|
||||||
|
|||||||
@@ -484,8 +484,8 @@ public class TileDecoder extends PbfDecoder {
|
|||||||
|
|
||||||
// only add last point if it is di
|
// only add last point if it is di
|
||||||
int ppos = cnt * 2;
|
int ppos = cnt * 2;
|
||||||
if (elem.points[elem.pointPos - ppos] != curX
|
if (elem.points[elem.pointNextPos - ppos] != curX
|
||||||
|| elem.points[elem.pointPos - ppos + 1] != curY)
|
|| elem.points[elem.pointNextPos - ppos + 1] != curY)
|
||||||
elem.addPoint(curX / mScale, curY / mScale);
|
elem.addPoint(curX / mScale, curY / mScale);
|
||||||
|
|
||||||
lastClip = false;
|
lastClip = false;
|
||||||
@@ -525,10 +525,10 @@ public class TileDecoder extends PbfDecoder {
|
|||||||
if (isPoly && isOuter && simplify && !testBBox(xmax - xmin, ymax - ymin)) {
|
if (isPoly && isOuter && simplify && !testBBox(xmax - xmin, ymax - ymin)) {
|
||||||
//log.debug("skip small poly "+ elem.indexPos + " > "
|
//log.debug("skip small poly "+ elem.indexPos + " > "
|
||||||
// + (xmax - xmin) * (ymax - ymin));
|
// + (xmax - xmin) * (ymax - ymin));
|
||||||
elem.pointPos -= elem.index[elem.indexPos];
|
elem.pointNextPos -= elem.index[elem.indexCurrentPos];
|
||||||
if (elem.indexPos > 0) {
|
if (elem.indexCurrentPos > 0) {
|
||||||
elem.indexPos -= 2;
|
elem.indexCurrentPos -= 2;
|
||||||
elem.index[elem.indexPos + 1] = -1;
|
elem.index[elem.indexCurrentPos + 1] = -1;
|
||||||
} else {
|
} else {
|
||||||
elem.type = GeometryType.NONE;
|
elem.type = GeometryType.NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,8 +266,8 @@ public class TileDecoder implements ITileDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeLastPoint() {
|
private void removeLastPoint() {
|
||||||
mMapElement.pointPos -= 2;
|
mMapElement.pointNextPos -= 2;
|
||||||
mMapElement.index[mMapElement.indexPos] -= 2;
|
mMapElement.index[mMapElement.indexCurrentPos] -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseLineString(JsonParser jp) throws IOException {
|
private void parseLineString(JsonParser jp) throws IOException {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -22,6 +22,7 @@ import org.oscim.layers.tile.buildings.BuildingLayer;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ public class MapzenTest extends GdxMapImpl {
|
|||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
UrlTileSource tileSource = OSciMap4TileSource.builder()
|
UrlTileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.url("https://vector.mapzen.com/osm/v0.8/all")
|
.url("https://vector.mapzen.com/osm/v0.8/all")
|
||||||
.apiKey("vector-tiles-xxxxxxx") // Put a proper API key
|
.apiKey("vector-tiles-xxxxxxx") // Put a proper API key
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Hannes Janetzek
|
||||||
|
* Copyright 2017 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.test;
|
package org.oscim.test;
|
||||||
|
|
||||||
import com.badlogic.gdx.Input;
|
import com.badlogic.gdx.Input;
|
||||||
@@ -7,6 +24,7 @@ import org.oscim.gdx.GdxMapApp;
|
|||||||
import org.oscim.gdx.GdxMapImpl;
|
import org.oscim.gdx.GdxMapImpl;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class AnimatorTest extends GdxMapImpl {
|
public class AnimatorTest extends GdxMapImpl {
|
||||||
@@ -15,7 +33,9 @@ public class AnimatorTest extends GdxMapImpl {
|
|||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
MapRenderer.setBackgroundColor(0xff000000);
|
MapRenderer.setBackgroundColor(0xff000000);
|
||||||
|
|
||||||
TileSource ts = new OSciMap4TileSource();
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
initDefaultLayers(ts, false, false, false);
|
initDefaultLayers(ts, false, false, false);
|
||||||
|
|
||||||
mMap.setMapPosition(0, 0, 1 << 4);
|
mMap.setMapPosition(0, 0, 1 << 4);
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -46,7 +48,10 @@ public class AtlasMarkerLayerTest extends MarkerLayerTest {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -47,7 +49,10 @@ public class AtlasMultiTextureTest extends MarkerLayerTest {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import org.oscim.layers.tile.buildings.BuildingLayer;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -48,7 +50,10 @@ public class ClusterMarkerLayerTest extends MarkerLayerTest {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -62,7 +62,9 @@ public class ExternalRenderThemeTest extends GdxMapImpl {
|
|||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
mMap.setMapPosition(53.08, 8.83, 1 << 14);
|
mMap.setMapPosition(53.08, 8.83, 1 << 14);
|
||||||
|
|
||||||
// TileSource tileSource = new OSciMap4TileSource();
|
/*TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();*/
|
||||||
|
|
||||||
MapFileTileSource tileSource = new MapFileTileSource();
|
MapFileTileSource tileSource = new MapFileTileSource();
|
||||||
// tileSource.setMapFile("/home/jeff/src/vtm/Freizeitkarte_DEU_NW.map");
|
// tileSource.setMapFile("/home/jeff/src/vtm/Freizeitkarte_DEU_NW.map");
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.oscim.gdx.GdxMapImpl;
|
|||||||
import org.oscim.renderer.GLState;
|
import org.oscim.renderer.GLState;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import static org.oscim.backend.GLAdapter.gl;
|
import static org.oscim.backend.GLAdapter.gl;
|
||||||
@@ -49,7 +50,9 @@ public class GdxSpriteBatchTest extends GdxMapImpl {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createLayers() {
|
protected void createLayers() {
|
||||||
TileSource tileSource = new OSciMap4TileSource();
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
initDefaultLayers(tileSource, false, true, false);
|
initDefaultLayers(tileSource, false, true, false);
|
||||||
mMap.setMapPosition(latitude, longitude, scale);
|
mMap.setMapPosition(latitude, longitude, scale);
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ public class LineRenderTest extends GdxMapImpl {
|
|||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
MapRenderer.setBackgroundColor(0xff000000);
|
MapRenderer.setBackgroundColor(0xff000000);
|
||||||
|
|
||||||
// TileSource ts = new OSciMap4TileSource();
|
/*TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();*/
|
||||||
// ts.setOption("url", "http://opensciencemap.org/tiles/vtm");
|
// ts.setOption("url", "http://opensciencemap.org/tiles/vtm");
|
||||||
// initDefaultLayers(ts, false, false, false);
|
// initDefaultLayers(ts, false, false, false);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import org.oscim.layers.vector.geometries.Style;
|
|||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.renderer.bucket.TextureItem;
|
import org.oscim.renderer.bucket.TextureItem;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -46,7 +48,10 @@ public class LineTexTest extends GdxMapApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -30,6 +30,8 @@ import org.oscim.scalebar.MapScaleBar;
|
|||||||
import org.oscim.scalebar.MapScaleBarLayer;
|
import org.oscim.scalebar.MapScaleBarLayer;
|
||||||
import org.oscim.scalebar.MetricUnitAdapter;
|
import org.oscim.scalebar.MetricUnitAdapter;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class MapTest extends GdxMapApp {
|
public class MapTest extends GdxMapApp {
|
||||||
@@ -38,7 +40,10 @@ public class MapTest extends GdxMapApp {
|
|||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
Map map = getMap();
|
Map map = getMap();
|
||||||
|
|
||||||
VectorTileLayer l = map.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = map.setBaseMap(tileSource);
|
||||||
|
|
||||||
GroupLayer groupLayer = new GroupLayer(mMap);
|
GroupLayer groupLayer = new GroupLayer(mMap);
|
||||||
groupLayer.layers.add(new BuildingLayer(map, l));
|
groupLayer.layers.add(new BuildingLayer(map, l));
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import org.oscim.layers.tile.vector.VectorTileLayer;
|
|||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -50,7 +52,10 @@ public class MarkerLayerTest extends GdxMapApp implements ItemizedLayer.OnItemGe
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -17,24 +17,30 @@
|
|||||||
package org.oscim.test;
|
package org.oscim.test;
|
||||||
|
|
||||||
import org.oscim.gdx.GdxMapApp;
|
import org.oscim.gdx.GdxMapApp;
|
||||||
import org.oscim.layers.tile.buildings.S3DBLayer;
|
import org.oscim.layers.tile.buildings.S3DBTileLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class S3DBLayerTest extends GdxMapApp {
|
public class OSciMapS3DBTest extends GdxMapApp {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
TileSource ts = OSciMap4TileSource
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
.builder()
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.url("http://opensciencemap.org/tiles/s3db")
|
.url("http://opensciencemap.org/tiles/s3db")
|
||||||
|
.zoomMin(16)
|
||||||
|
.zoomMax(16)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
S3DBLayer tl = new S3DBLayer(mMap, ts);
|
S3DBTileLayer tl = new S3DBTileLayer(mMap, ts);
|
||||||
mMap.layers().add(tl);
|
mMap.layers().add(tl);
|
||||||
|
|
||||||
mMap.setMapPosition(53.08, 8.82, 1 << 17);
|
mMap.setMapPosition(53.08, 8.82, 1 << 17);
|
||||||
@@ -43,6 +49,6 @@ public class S3DBLayerTest extends GdxMapApp {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
init();
|
init();
|
||||||
run(new S3DBLayerTest());
|
run(new OSciMapS3DBTest());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.layers.vector.PathLayer;
|
import org.oscim.layers.vector.PathLayer;
|
||||||
import org.oscim.map.Map.UpdateListener;
|
import org.oscim.map.Map.UpdateListener;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -42,7 +44,10 @@ public class PathLayerTest extends GdxMapApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -32,6 +32,7 @@ import org.oscim.theme.styles.LineStyle;
|
|||||||
import org.oscim.theme.styles.LineStyle.LineBuilder;
|
import org.oscim.theme.styles.LineStyle.LineBuilder;
|
||||||
import org.oscim.theme.styles.RenderStyle;
|
import org.oscim.theme.styles.RenderStyle;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -71,7 +72,9 @@ public class RuleVisitorTest extends GdxMapImpl {
|
|||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
MapRenderer.setBackgroundColor(0xf0f0f0);
|
MapRenderer.setBackgroundColor(0xf0f0f0);
|
||||||
|
|
||||||
TileSource ts = new OSciMap4TileSource();
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
VectorTileLayer l = mMap.setBaseMap(ts);
|
VectorTileLayer l = mMap.setBaseMap(ts);
|
||||||
|
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -23,14 +23,12 @@ import org.oscim.gdx.GdxMapImpl;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.RenderTheme;
|
import org.oscim.theme.RenderTheme;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class ThemeBuilderTest extends GdxMapImpl {
|
public class ThemeBuilderTest extends GdxMapImpl {
|
||||||
|
|
||||||
final Logger log = LoggerFactory.getLogger(S3DBLayerTest.class);
|
|
||||||
|
|
||||||
static class MyTheme extends ThemeBuilder {
|
static class MyTheme extends ThemeBuilder {
|
||||||
public MyTheme() {
|
public MyTheme() {
|
||||||
rules(
|
rules(
|
||||||
@@ -57,7 +55,10 @@ public class ThemeBuilderTest extends GdxMapImpl {
|
|||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
|
|
||||||
RenderTheme t = new MyTheme().build();
|
RenderTheme t = new MyTheme().build();
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import org.oscim.renderer.MapRenderer;
|
|||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.QueryResult;
|
import org.oscim.tiling.QueryResult;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class TileRenderTest extends GdxMapApp {
|
public class TileRenderTest extends GdxMapApp {
|
||||||
@@ -92,7 +93,9 @@ public class TileRenderTest extends GdxMapApp {
|
|||||||
TestVectorTileLayer tileLayer = new TestVectorTileLayer(mMap, tileManager);
|
TestVectorTileLayer tileLayer = new TestVectorTileLayer(mMap, tileManager);
|
||||||
tileLoader[0] = tileLayer.getTileLoader();
|
tileLoader[0] = tileLayer.getTileLoader();
|
||||||
|
|
||||||
TileSource tileSource = new OSciMap4TileSource();
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
//TileSource tileSource = new TestTileSource();
|
//TileSource tileSource = new TestTileSource();
|
||||||
|
|
||||||
tileLayer.setTileSource(tileSource);
|
tileLayer.setTileSource(tileSource);
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import org.oscim.layers.vector.VectorLayer;
|
|||||||
import org.oscim.layers.vector.geometries.PointDrawable;
|
import org.oscim.layers.vector.geometries.PointDrawable;
|
||||||
import org.oscim.layers.vector.geometries.Style;
|
import org.oscim.layers.vector.geometries.Style;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.ColorUtil;
|
import org.oscim.utils.ColorUtil;
|
||||||
|
|
||||||
@@ -32,7 +34,10 @@ public class VectorLayerTest extends GdxMapApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -24,6 +24,7 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class Gdx3DTest extends GdxMapImpl {
|
public class Gdx3DTest extends GdxMapImpl {
|
||||||
@@ -34,7 +35,9 @@ public class Gdx3DTest extends GdxMapImpl {
|
|||||||
|
|
||||||
mMap.setMapPosition(53.1, 8.8, 1 << 15);
|
mMap.setMapPosition(53.1, 8.8, 1 << 15);
|
||||||
|
|
||||||
TileSource ts = new OSciMap4TileSource();
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
// initDefaultLayers(ts, false, false, false);
|
// initDefaultLayers(ts, false, false, false);
|
||||||
|
|
||||||
VectorTileLayer mMapLayer = mMap.setBaseMap(ts);
|
VectorTileLayer mMapLayer = mMap.setBaseMap(ts);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.oscim.gdx.GdxMapApp;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.theme.carto.RenderTheme;
|
import org.oscim.theme.carto.RenderTheme;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
@@ -32,7 +33,9 @@ public class ThemeTest extends GdxMapApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
UrlTileSource ts = new OSciMap4TileSource();
|
UrlTileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(ts);
|
VectorTileLayer l = mMap.setBaseMap(ts);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 Izumi Kawashima
|
||||||
|
*
|
||||||
|
* 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.web.client;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class BuildingSolutionControl {
|
||||||
|
private final String divQuerySelector;
|
||||||
|
public final int MAX_VALUE = 65536;
|
||||||
|
private Collection<ValueChangeListener> listeners = new HashSet<>();
|
||||||
|
|
||||||
|
public BuildingSolutionControl(String divQuerySelector) {
|
||||||
|
this.divQuerySelector = divQuerySelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
initNative(divQuerySelector);
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private native void initNative(String divQuerySelector)/*-{
|
||||||
|
var bsc = $doc.querySelector(divQuerySelector);
|
||||||
|
var that = this;
|
||||||
|
function onUpdate(val){
|
||||||
|
that.@org.oscim.web.client.BuildingSolutionControl::fireValueChangeListeners(I)(val);
|
||||||
|
}
|
||||||
|
bsc.addEventListener("input",function(){onUpdate(this.value);});
|
||||||
|
bsc.addEventListener("change",function(){onUpdate(this.value);});
|
||||||
|
}-*/;
|
||||||
|
|
||||||
|
private native void refresh()/*-{
|
||||||
|
|
||||||
|
}-*/;
|
||||||
|
|
||||||
|
public void addValueChangeListener(ValueChangeListener l) {
|
||||||
|
this.listeners.add(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeValueChangeListener(ValueChangeListener l) {
|
||||||
|
this.listeners.remove(l);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireValueChangeListeners(int val) {
|
||||||
|
for (ValueChangeListener l : this.listeners) {
|
||||||
|
l.onValueChange(val, MAX_VALUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ValueChangeListener {
|
||||||
|
void onValueChange(int val, int max);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016 Izumi Kawashima
|
* Copyright 2016-2017 Izumi Kawashima
|
||||||
* Copyright 2017 devemux86
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
@@ -33,9 +33,10 @@ import org.oscim.gdx.client.MapConfig;
|
|||||||
import org.oscim.gdx.client.MapUrl;
|
import org.oscim.gdx.client.MapUrl;
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.buildings.S3DBLayer;
|
import org.oscim.layers.tile.buildings.S3DBTileLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.renderer.ExtrusionRenderer;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.theme.StreamRenderTheme;
|
import org.oscim.theme.StreamRenderTheme;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
@@ -49,6 +50,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
class GwtMap extends GdxMap {
|
class GwtMap extends GdxMap {
|
||||||
static final Logger log = LoggerFactory.getLogger(GwtMap.class);
|
static final Logger log = LoggerFactory.getLogger(GwtMap.class);
|
||||||
|
|
||||||
|
BuildingLayer mBuildingLayer;
|
||||||
|
BuildingSolutionControl mBuildingSolutionControl;
|
||||||
SearchBox mSearchBox;
|
SearchBox mSearchBox;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -138,24 +141,40 @@ class GwtMap extends GdxMap {
|
|||||||
.zoomMin(16)
|
.zoomMin(16)
|
||||||
.zoomMax(16)
|
.zoomMax(16)
|
||||||
.build();
|
.build();
|
||||||
mMap.layers().add(new S3DBLayer(mMap, ts));
|
mMap.layers().add(new S3DBTileLayer(mMap, ts));
|
||||||
}
|
}
|
||||||
if (l != null) {
|
if (l != null) {
|
||||||
boolean nolabels = mapUrl.params.containsKey("nolabels");
|
boolean nolabels = mapUrl.params.containsKey("nolabels");
|
||||||
boolean nobuildings = mapUrl.params.containsKey("nobuildings");
|
boolean nobuildings = mapUrl.params.containsKey("nobuildings");
|
||||||
|
|
||||||
if (!nobuildings && !s3db)
|
if (!nobuildings && !s3db) {
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mBuildingLayer = new BuildingLayer(mMap, l);
|
||||||
|
((ExtrusionRenderer) mBuildingLayer.getRenderer()).setZLimit((float) 65536 / 10);
|
||||||
|
mMap.layers().add(mBuildingLayer);
|
||||||
|
}
|
||||||
|
|
||||||
if (!nolabels)
|
if (!nolabels)
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
}
|
}
|
||||||
|
|
||||||
mSearchBox = new SearchBox(mMap);
|
mSearchBox = new SearchBox(mMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createLayers() {
|
protected void createLayers() {
|
||||||
|
mBuildingSolutionControl = new BuildingSolutionControl("#building-solution-input");
|
||||||
|
mBuildingSolutionControl.addValueChangeListener(new BuildingSolutionControl.ValueChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onValueChange(int val, int max) {
|
||||||
|
if (mBuildingLayer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
((ExtrusionRenderer) mBuildingLayer.getRenderer()).setZLimit((float) val / 10);
|
||||||
|
|
||||||
|
mMap.updateMap(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mBuildingSolutionControl.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,3 +104,17 @@ html,body {
|
|||||||
background-color: #DDDDDD;
|
background-color: #DDDDDD;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#building-solution{
|
||||||
|
z-index: 20001;
|
||||||
|
position: absolute;
|
||||||
|
top: 40px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
input[type=range][orient=vertical]{
|
||||||
|
writing-mode: bt-lr; /* IE */
|
||||||
|
-webkit-appearance: slider-vertical; /* WebKit */
|
||||||
|
width: 8px;
|
||||||
|
height: 175px;
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -73,5 +73,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="building-solution">
|
||||||
|
<input type="range" orient="vertical" id="building-solution-input" min="0" max="65536" value="65536"/>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ uniform mat4 u_mvp;
|
|||||||
uniform vec4 u_color[4];
|
uniform vec4 u_color[4];
|
||||||
uniform int u_mode;
|
uniform int u_mode;
|
||||||
uniform float u_alpha;
|
uniform float u_alpha;
|
||||||
|
uniform float u_zlimit;
|
||||||
attribute vec4 a_pos;
|
attribute vec4 a_pos;
|
||||||
attribute vec2 a_light;
|
attribute vec2 a_light;
|
||||||
varying vec4 color;
|
varying vec4 color;
|
||||||
@@ -13,7 +14,11 @@ const float ff = 255.0;
|
|||||||
void
|
void
|
||||||
main(){
|
main(){
|
||||||
// change height by u_alpha
|
// change height by u_alpha
|
||||||
gl_Position = u_mvp * vec4(a_pos.xy, a_pos.z * u_alpha, 1.0);
|
float height = a_pos.z * u_alpha;
|
||||||
|
if (height > u_zlimit) {
|
||||||
|
height = u_zlimit;
|
||||||
|
}
|
||||||
|
gl_Position = u_mvp * vec4(a_pos.xy, height, 1.0);
|
||||||
// depth = gl_Position.z;
|
// depth = gl_Position.z;
|
||||||
if (u_mode == -1) {
|
if (u_mode == -1) {
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016 Andrey Novikov
|
* Copyright 2016 Andrey Novikov
|
||||||
|
* Copyright 2017 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -17,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.core;
|
package org.oscim.core;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/* TODO
|
/* TODO
|
||||||
* - check indexPos < Short.Max
|
* - check indexPos < Short.Max
|
||||||
* - should make internals private, maybe
|
* - should make internals private, maybe
|
||||||
@@ -56,23 +59,35 @@ public class GeometryBuffer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The points.
|
* The points.
|
||||||
|
* <p>
|
||||||
|
* POLY/LINE: store point in order of polygon with
|
||||||
|
* points[2 * n + 0] = x; points[2 * n + 1] = y; n is a N.
|
||||||
|
* <p>
|
||||||
|
* MESH: store points anywhere with
|
||||||
|
* points[3 * n + 0] = x; points[3 * n + 1] = y; points[3 * n + 2] = z; n ∈ ℕ0.
|
||||||
*/
|
*/
|
||||||
public float[] points;
|
public float[] points;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The indexes.
|
* The indexes.
|
||||||
|
* <p>
|
||||||
|
* POLY/LINE: store 2 * number of points of each polygon / line. Point is (x, y).
|
||||||
|
* <p>
|
||||||
|
* MESH: store point indices of triangle (p1, p2, p3) with
|
||||||
|
* index[3 * n + 0] = p1; index[3 * n + 1] = p2; index[3 * n + 2] = p3; n ∈ ℕ0.
|
||||||
|
* Point p is (x, y, z).
|
||||||
*/
|
*/
|
||||||
public int[] index;
|
public int[] index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current index position.
|
* The current index position.
|
||||||
*/
|
*/
|
||||||
public int indexPos;
|
public int indexCurrentPos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current position in points array.
|
* The next position to insert a point in points array (equal to array size).
|
||||||
*/
|
*/
|
||||||
public int pointPos;
|
public int pointNextPos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current geometry type.
|
* The current geometry type.
|
||||||
@@ -111,11 +126,27 @@ public class GeometryBuffer {
|
|||||||
this.points = points;
|
this.points = points;
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.type = GeometryType.NONE;
|
this.type = GeometryType.NONE;
|
||||||
this.indexPos = 0;
|
this.indexCurrentPos = 0;
|
||||||
this.pointPos = 0;
|
this.pointNextPos = 0;
|
||||||
this.pointLimit = points.length - 2;
|
this.pointLimit = points.length - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param buffer the buffer to copy
|
||||||
|
*/
|
||||||
|
public GeometryBuffer(GeometryBuffer buffer) {
|
||||||
|
int indexSize = 0;
|
||||||
|
while (indexSize < buffer.index.length && buffer.index[indexSize] != -1) {
|
||||||
|
indexSize++;
|
||||||
|
}
|
||||||
|
this.points = Arrays.copyOf(buffer.points, buffer.pointNextPos);
|
||||||
|
this.index = Arrays.copyOf(buffer.index, indexSize);
|
||||||
|
|
||||||
|
this.pointNextPos = buffer.pointNextPos;
|
||||||
|
this.indexCurrentPos = buffer.indexCurrentPos;
|
||||||
|
this.type = buffer.type;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param out PointF to set coordinates to.
|
* @param out PointF to set coordinates to.
|
||||||
* @return when out is null a temporary PointF is
|
* @return when out is null a temporary PointF is
|
||||||
@@ -145,7 +176,7 @@ public class GeometryBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getNumPoints() {
|
public int getNumPoints() {
|
||||||
return pointPos >> 1;
|
return pointNextPos >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,8 +184,8 @@ public class GeometryBuffer {
|
|||||||
*/
|
*/
|
||||||
public GeometryBuffer clear() {
|
public GeometryBuffer clear() {
|
||||||
index[0] = 0;
|
index[0] = 0;
|
||||||
indexPos = 0;
|
indexCurrentPos = 0;
|
||||||
pointPos = 0;
|
pointNextPos = 0;
|
||||||
type = GeometryType.NONE;
|
type = GeometryType.NONE;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -166,13 +197,13 @@ public class GeometryBuffer {
|
|||||||
* @param y the y ordinate
|
* @param y the y ordinate
|
||||||
*/
|
*/
|
||||||
public GeometryBuffer addPoint(float x, float y) {
|
public GeometryBuffer addPoint(float x, float y) {
|
||||||
if (pointPos > pointLimit)
|
if (pointNextPos > pointLimit)
|
||||||
ensurePointSize((pointPos >> 1) + 1, true);
|
ensurePointSize((pointNextPos >> 1) + 1, true);
|
||||||
|
|
||||||
points[pointPos++] = x;
|
points[pointNextPos++] = x;
|
||||||
points[pointPos++] = y;
|
points[pointNextPos++] = y;
|
||||||
|
|
||||||
index[indexPos] += 2;
|
index[indexCurrentPos] += 2;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +219,10 @@ public class GeometryBuffer {
|
|||||||
return type == GeometryType.POINT;
|
return type == GeometryType.POINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTris() {
|
||||||
|
return type == GeometryType.TRIS;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the point x,y at position pos.
|
* Sets the point x,y at position pos.
|
||||||
*
|
*
|
||||||
@@ -214,19 +249,19 @@ public class GeometryBuffer {
|
|||||||
setOrCheckMode(GeometryType.LINE);
|
setOrCheckMode(GeometryType.LINE);
|
||||||
|
|
||||||
/* ignore */
|
/* ignore */
|
||||||
if (index[indexPos] > 0) {
|
if (index[indexCurrentPos] > 0) {
|
||||||
|
|
||||||
/* start next */
|
/* start next */
|
||||||
if ((index[0] >= 0) && (++indexPos >= index.length))
|
if ((index[0] >= 0) && (++indexCurrentPos >= index.length))
|
||||||
ensureIndexSize(indexPos, true);
|
ensureIndexSize(indexCurrentPos, true);
|
||||||
|
|
||||||
/* initialize with zero points */
|
/* initialize with zero points */
|
||||||
index[indexPos] = 0;
|
index[indexCurrentPos] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set new end marker */
|
/* set new end marker */
|
||||||
if (index.length > indexPos + 1)
|
if (index.length > indexCurrentPos + 1)
|
||||||
index[indexPos + 1] = -1;
|
index[indexCurrentPos + 1] = -1;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,23 +272,23 @@ public class GeometryBuffer {
|
|||||||
boolean start = (type == GeometryType.NONE);
|
boolean start = (type == GeometryType.NONE);
|
||||||
setOrCheckMode(GeometryType.POLY);
|
setOrCheckMode(GeometryType.POLY);
|
||||||
|
|
||||||
if ((indexPos + 3) > index.length)
|
if ((indexCurrentPos + 3) > index.length)
|
||||||
ensureIndexSize(indexPos + 2, true);
|
ensureIndexSize(indexCurrentPos + 2, true);
|
||||||
|
|
||||||
if (!start && index[indexPos] != 0) {
|
if (!start && index[indexCurrentPos] != 0) {
|
||||||
/* end polygon */
|
/* end polygon */
|
||||||
index[++indexPos] = 0;
|
index[++indexCurrentPos] = 0;
|
||||||
|
|
||||||
/* next polygon start */
|
/* next polygon start */
|
||||||
indexPos++;
|
indexCurrentPos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize with zero points */
|
/* initialize with zero points */
|
||||||
index[indexPos] = 0;
|
index[indexCurrentPos] = 0;
|
||||||
|
|
||||||
/* set new end marker */
|
/* set new end marker */
|
||||||
if (index.length > indexPos + 1)
|
if (index.length > indexCurrentPos + 1)
|
||||||
index[indexPos + 1] = -1;
|
index[indexCurrentPos + 1] = -1;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -264,19 +299,19 @@ public class GeometryBuffer {
|
|||||||
public void startHole() {
|
public void startHole() {
|
||||||
checkMode(GeometryType.POLY);
|
checkMode(GeometryType.POLY);
|
||||||
|
|
||||||
if ((indexPos + 2) > index.length)
|
if ((indexCurrentPos + 2) > index.length)
|
||||||
ensureIndexSize(indexPos + 1, true);
|
ensureIndexSize(indexCurrentPos + 1, true);
|
||||||
|
|
||||||
/* initialize with zero points */
|
/* initialize with zero points */
|
||||||
index[++indexPos] = 0;
|
index[++indexCurrentPos] = 0;
|
||||||
|
|
||||||
/* set new end marker */
|
/* set new end marker */
|
||||||
if (index.length > indexPos + 1)
|
if (index.length > indexCurrentPos + 1)
|
||||||
index[indexPos + 1] = -1;
|
index[indexCurrentPos + 1] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeometryBuffer translate(float dx, float dy) {
|
public GeometryBuffer translate(float dx, float dy) {
|
||||||
for (int i = 0; i < pointPos; i += 2) {
|
for (int i = 0; i < pointNextPos; i += 2) {
|
||||||
points[i] += dx;
|
points[i] += dx;
|
||||||
points[i + 1] += dy;
|
points[i + 1] += dy;
|
||||||
}
|
}
|
||||||
@@ -284,7 +319,7 @@ public class GeometryBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GeometryBuffer scale(float scaleX, float scaleY) {
|
public GeometryBuffer scale(float scaleX, float scaleY) {
|
||||||
for (int i = 0; i < pointPos; i += 2) {
|
for (int i = 0; i < pointNextPos; i += 2) {
|
||||||
points[i] *= scaleX;
|
points[i] *= scaleX;
|
||||||
points[i + 1] *= scaleY;
|
points[i + 1] *= scaleY;
|
||||||
}
|
}
|
||||||
@@ -439,24 +474,43 @@ public class GeometryBuffer {
|
|||||||
for (int i = 0; i < index.length; i++) {
|
for (int i = 0; i < index.length; i++) {
|
||||||
if (index[i] < 0)
|
if (index[i] < 0)
|
||||||
break;
|
break;
|
||||||
if (index[i] == 0)
|
|
||||||
continue;
|
|
||||||
sb.append(":");
|
|
||||||
sb.append(index[i]);
|
|
||||||
sb.append('\n');
|
|
||||||
|
|
||||||
for (int j = 0; j < index[i]; j += 2) {
|
if (!isTris()) {
|
||||||
sb.append('[')
|
if (index[i] == 0)
|
||||||
.append(points[o + j])
|
continue;
|
||||||
.append(',')
|
sb.append("POLY (")
|
||||||
.append(points[o + j + 1])
|
.append(i)
|
||||||
|
.append(") { ");
|
||||||
|
|
||||||
|
for (int j = 0; j < index[i]; j += 2) {
|
||||||
|
sb.append('[')
|
||||||
|
.append(points[o + j])
|
||||||
|
.append(", ")
|
||||||
|
.append(points[o + j + 1])
|
||||||
|
.append(']');
|
||||||
|
|
||||||
|
if (j % 4 == 0)
|
||||||
|
sb.append('\n');
|
||||||
|
}
|
||||||
|
sb.append(" } \tnumPoints:")
|
||||||
|
.append(index[i])
|
||||||
|
.append('\n');
|
||||||
|
o += index[i];
|
||||||
|
} else {
|
||||||
|
if (i % 3 == 0)
|
||||||
|
sb.append("TRIS { ");
|
||||||
|
sb.append('\t')
|
||||||
|
.append(index[i])
|
||||||
|
.append('[')
|
||||||
|
.append(points[3 * index[i]])
|
||||||
|
.append(", ")
|
||||||
|
.append(points[3 * index[i] + 1])
|
||||||
|
.append(", ")
|
||||||
|
.append(points[3 * index[i] + 2])
|
||||||
.append(']');
|
.append(']');
|
||||||
|
if (i % 3 == 2)
|
||||||
if (j % 4 == 0)
|
sb.append(" }\n");
|
||||||
sb.append('\n');
|
|
||||||
}
|
}
|
||||||
sb.append('\n');
|
|
||||||
o += index[i];
|
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,15 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.core;
|
package org.oscim.core;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The MapElement class is a reusable containter for a geometry
|
* The MapElement class is a reusable container for a geometry
|
||||||
* with tags.
|
* with tags.
|
||||||
* MapElement is created by TileDataSource(s) and passed to
|
* MapElement is created by TileDataSource(s) and passed to
|
||||||
* MapTileLoader via ITileDataSink.process().
|
* MapTileLoader via ITileDataSink.process().
|
||||||
* This is just a buffer that belongs to TileDataSource,
|
* This is just a buffer that belongs to TileDataSource,
|
||||||
* so dont keep a reference to it when passed as parameter.
|
* so don't keep a reference to it when passed as parameter.
|
||||||
*/
|
*/
|
||||||
public class MapElement extends GeometryBuffer {
|
public class MapElement extends GeometryBuffer {
|
||||||
|
|
||||||
@@ -51,6 +49,16 @@ public class MapElement extends GeometryBuffer {
|
|||||||
super(points, index);
|
super(points, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param element the map element to copy
|
||||||
|
*/
|
||||||
|
public MapElement(MapElement element) {
|
||||||
|
super(element);
|
||||||
|
this.tags.set(element.tags.asArray());
|
||||||
|
this.labelPosition = element.labelPosition;
|
||||||
|
this.setLayer(element.layer);
|
||||||
|
}
|
||||||
|
|
||||||
public void setLabelPosition(float x, float y) {
|
public void setLabelPosition(float x, float y) {
|
||||||
labelPosition = new PointF(x, y);
|
labelPosition = new PointF(x, y);
|
||||||
}
|
}
|
||||||
@@ -68,32 +76,6 @@ public class MapElement extends GeometryBuffer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
return tags.toString() + '\n' + super.toString() + '\n';
|
return tags.toString() + '\n' + super.toString() + '\n';
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return a deep copy of this MapElement
|
|
||||||
*/
|
|
||||||
public MapElement clone() {
|
|
||||||
int indexSize = this.indexPos + 1;
|
|
||||||
for (int i = 0; i < this.index.length; i++) {
|
|
||||||
if (this.index[i] == -1) {
|
|
||||||
indexSize = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
float[] copyPoints = Arrays.copyOf(this.points, this.pointPos);
|
|
||||||
int[] copyIndex = Arrays.copyOf(this.index, indexSize);
|
|
||||||
|
|
||||||
MapElement copy = new MapElement(copyPoints, copyIndex);
|
|
||||||
copy.tags.set(this.tags.asArray());
|
|
||||||
copy.pointPos = this.pointPos;
|
|
||||||
copy.labelPosition = this.labelPosition;
|
|
||||||
copy.setLayer(this.layer);
|
|
||||||
copy.indexPos = this.indexPos;
|
|
||||||
copy.type = this.type;
|
|
||||||
return copy;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,13 @@ public class Tag {
|
|||||||
public static final String KEY_MATERIAL = "material";
|
public static final String KEY_MATERIAL = "material";
|
||||||
public static final String KEY_MIN_HEIGHT = "min_height";
|
public static final String KEY_MIN_HEIGHT = "min_height";
|
||||||
public static final String KEY_ROOF = "roof";
|
public static final String KEY_ROOF = "roof";
|
||||||
|
public static final String KEY_ROOF_ANGLE = "roof:angle";
|
||||||
public static final String KEY_ROOF_COLOR = "roof:colour";
|
public static final String KEY_ROOF_COLOR = "roof:colour";
|
||||||
|
public static final String KEY_ROOF_DIRECTION = "roof:direction";
|
||||||
public static final String KEY_ROOF_HEIGHT = "roof:height";
|
public static final String KEY_ROOF_HEIGHT = "roof:height";
|
||||||
public static final String KEY_ROOF_LEVELS = "roof:levels";
|
public static final String KEY_ROOF_LEVELS = "roof:levels";
|
||||||
public static final String KEY_ROOF_MATERIAL = "roof:material";
|
public static final String KEY_ROOF_MATERIAL = "roof:material";
|
||||||
|
public static final String KEY_ROOF_ORIENTATION = "roof:orientation";
|
||||||
public static final String KEY_ROOF_SHAPE = "roof:shape";
|
public static final String KEY_ROOF_SHAPE = "roof:shape";
|
||||||
public static final String KEY_VOLUME = "volume";
|
public static final String KEY_VOLUME = "volume";
|
||||||
|
|
||||||
@@ -89,7 +92,9 @@ public class Tag {
|
|||||||
public static final String VALUE_PYRAMIDAL = "pyramidal";
|
public static final String VALUE_PYRAMIDAL = "pyramidal";
|
||||||
public static final String VALUE_ROUND = "round";
|
public static final String VALUE_ROUND = "round";
|
||||||
public static final String VALUE_SALTBOX = "saltbox";
|
public static final String VALUE_SALTBOX = "saltbox";
|
||||||
public static final String VALUE_SKILLON = "skillion";
|
public static final String VALUE_SKILLION = "skillion";
|
||||||
|
|
||||||
|
public static final String VALUE_ACROSS = "across"; // orientation across
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The key of this tag.
|
* The key of this tag.
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.layers.tile;
|
package org.oscim.layers.tile;
|
||||||
|
|
||||||
|
import org.oscim.core.MercatorProjection;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLoader;
|
import org.oscim.layers.tile.vector.VectorTileLoader;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelTileLoaderHook;
|
import org.oscim.layers.tile.vector.labeling.LabelTileLoaderHook;
|
||||||
@@ -340,6 +341,15 @@ public class MapTile extends Tile {
|
|||||||
return ((t.tileX % 4) + (t.tileY % 4 * 4) + 1);
|
return ((t.tileX % 4) + (t.tileY % 4 * 4) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the corresponding ground scale
|
||||||
|
*/
|
||||||
|
public float getGroundScale() {
|
||||||
|
double lat = MercatorProjection.toLatitude(this.y);
|
||||||
|
return (float) MercatorProjection
|
||||||
|
.groundResolutionWithScale(lat, 1 << this.zoomLevel);
|
||||||
|
}
|
||||||
|
|
||||||
public MapTile getProxyChild(int id, byte state) {
|
public MapTile getProxyChild(int id, byte state) {
|
||||||
if ((proxy & (1 << id)) == 0)
|
if ((proxy & (1 << id)) == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
package org.oscim.layers.tile.buildings;
|
package org.oscim.layers.tile.buildings;
|
||||||
|
|
||||||
import org.oscim.core.MapElement;
|
import org.oscim.core.MapElement;
|
||||||
import org.oscim.core.MercatorProjection;
|
|
||||||
import org.oscim.core.Tag;
|
import org.oscim.core.Tag;
|
||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.layers.tile.MapTile;
|
import org.oscim.layers.tile.MapTile;
|
||||||
@@ -29,12 +28,10 @@ import org.oscim.layers.tile.vector.VectorTileLayer.TileLoaderThemeHook;
|
|||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.renderer.OffscreenRenderer;
|
import org.oscim.renderer.OffscreenRenderer;
|
||||||
import org.oscim.renderer.OffscreenRenderer.Mode;
|
import org.oscim.renderer.OffscreenRenderer.Mode;
|
||||||
import org.oscim.renderer.bucket.ExtrusionBucket;
|
|
||||||
import org.oscim.renderer.bucket.ExtrusionBuckets;
|
import org.oscim.renderer.bucket.ExtrusionBuckets;
|
||||||
import org.oscim.renderer.bucket.RenderBuckets;
|
import org.oscim.renderer.bucket.RenderBuckets;
|
||||||
import org.oscim.theme.styles.ExtrusionStyle;
|
import org.oscim.theme.styles.ExtrusionStyle;
|
||||||
import org.oscim.theme.styles.RenderStyle;
|
import org.oscim.theme.styles.RenderStyle;
|
||||||
import org.oscim.utils.pool.Inlist;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -49,12 +46,12 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
private final static int MIN_ZOOM = 17;
|
private final static int MIN_ZOOM = 17;
|
||||||
private final static int MAX_ZOOM = 17;
|
private final static int MAX_ZOOM = 17;
|
||||||
|
|
||||||
private final static boolean POST_AA = false;
|
public static boolean POST_AA = false;
|
||||||
public static boolean TRANSLUCENT = true;
|
public static boolean TRANSLUCENT = true;
|
||||||
|
|
||||||
private static final Object BUILDING_DATA = BuildingLayer.class.getName();
|
private static final Object BUILDING_DATA = BuildingLayer.class.getName();
|
||||||
|
|
||||||
// Can replace with Multimap in Java 8
|
// Can be replaced with Multimap in Java 8
|
||||||
private HashMap<Integer, List<BuildingElement>> mBuildings = new HashMap<>();
|
private HashMap<Integer, List<BuildingElement>> mBuildings = new HashMap<>();
|
||||||
|
|
||||||
class BuildingElement {
|
class BuildingElement {
|
||||||
@@ -70,10 +67,14 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BuildingLayer(Map map, VectorTileLayer tileLayer) {
|
public BuildingLayer(Map map, VectorTileLayer tileLayer) {
|
||||||
this(map, tileLayer, MIN_ZOOM, MAX_ZOOM);
|
this(map, tileLayer, MIN_ZOOM, MAX_ZOOM, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax) {
|
public BuildingLayer(Map map, VectorTileLayer tileLayer, boolean mesh) {
|
||||||
|
this(map, tileLayer, MIN_ZOOM, MAX_ZOOM, mesh);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax, boolean mesh) {
|
||||||
|
|
||||||
super(map);
|
super(map);
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
|
|
||||||
mRenderer = new BuildingRenderer(tileLayer.tileRenderer(),
|
mRenderer = new BuildingRenderer(tileLayer.tileRenderer(),
|
||||||
zoomMin, zoomMax,
|
zoomMin, zoomMax,
|
||||||
false, TRANSLUCENT);
|
mesh, !mesh && TRANSLUCENT); // alpha must be disabled for mesh renderer
|
||||||
if (POST_AA)
|
if (POST_AA)
|
||||||
mRenderer = new OffscreenRenderer(Mode.SSAO_FXAA, mRenderer);
|
mRenderer = new OffscreenRenderer(Mode.SSAO_FXAA, mRenderer);
|
||||||
}
|
}
|
||||||
@@ -109,7 +110,7 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
buildingElements = new ArrayList<>();
|
buildingElements = new ArrayList<>();
|
||||||
mBuildings.put(tile.hashCode(), buildingElements);
|
mBuildings.put(tile.hashCode(), buildingElements);
|
||||||
}
|
}
|
||||||
element = element.clone(); // Deep copy, because element will be cleared
|
element = new MapElement(element); // Deep copy, because element will be cleared
|
||||||
buildingElements.add(new BuildingElement(element, extrusion, isBuildingPart));
|
buildingElements.add(new BuildingElement(element, extrusion, isBuildingPart));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -153,23 +154,7 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
height = extrusion.defaultHeight * 100;
|
height = extrusion.defaultHeight * 100;
|
||||||
|
|
||||||
ExtrusionBuckets ebs = get(tile);
|
ExtrusionBuckets ebs = get(tile);
|
||||||
|
ebs.addPolyElement(element, tile.getGroundScale(), extrusion.colors, height, minHeight);
|
||||||
for (ExtrusionBucket b = ebs.buckets; b != null; b = b.next()) {
|
|
||||||
if (b.colors == extrusion.colors) {
|
|
||||||
b.add(element, height, minHeight);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double lat = MercatorProjection.toLatitude(tile.y);
|
|
||||||
float groundScale = (float) MercatorProjection
|
|
||||||
.groundResolutionWithScale(lat, 1 << tile.zoomLevel);
|
|
||||||
|
|
||||||
ebs.buckets = Inlist.push(ebs.buckets,
|
|
||||||
new ExtrusionBucket(0, groundScale,
|
|
||||||
extrusion.colors));
|
|
||||||
|
|
||||||
ebs.buckets.add(element, height, minHeight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -211,13 +196,17 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
mBuildings.remove(tile.hashCode());
|
mBuildings.remove(tile.hashCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tile the MapTile
|
||||||
|
* @return ExtrusionBuckets of the tile
|
||||||
|
*/
|
||||||
public static ExtrusionBuckets get(MapTile tile) {
|
public static ExtrusionBuckets get(MapTile tile) {
|
||||||
ExtrusionBuckets eb = (ExtrusionBuckets) tile.getData(BUILDING_DATA);
|
ExtrusionBuckets ebs = (ExtrusionBuckets) tile.getData(BUILDING_DATA);
|
||||||
if (eb == null) {
|
if (ebs == null) {
|
||||||
eb = new ExtrusionBuckets(tile);
|
ebs = new ExtrusionBuckets(tile);
|
||||||
tile.addData(BUILDING_DATA, eb);
|
tile.addData(BUILDING_DATA, ebs);
|
||||||
}
|
}
|
||||||
return eb;
|
return ebs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -226,7 +215,7 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook {
|
|||||||
processElements(tile);
|
processElements(tile);
|
||||||
get(tile).prepare();
|
get(tile).prepare();
|
||||||
} else
|
} else
|
||||||
get(tile).setBuckets(null);
|
get(tile).resetBuckets(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// private int multi;
|
// private int multi;
|
||||||
|
|||||||
98
vtm/src/org/oscim/layers/tile/buildings/S3DBTileLayer.java
Normal file
98
vtm/src/org/oscim/layers/tile/buildings/S3DBTileLayer.java
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
*
|
||||||
|
* 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.layers.tile.buildings;
|
||||||
|
|
||||||
|
import org.oscim.layers.tile.TileLayer;
|
||||||
|
import org.oscim.layers.tile.TileManager;
|
||||||
|
import org.oscim.layers.tile.TileRenderer;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
import org.oscim.renderer.GLViewport;
|
||||||
|
import org.oscim.renderer.LayerRenderer;
|
||||||
|
import org.oscim.renderer.OffscreenRenderer;
|
||||||
|
import org.oscim.renderer.OffscreenRenderer.Mode;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
|
||||||
|
public class S3DBTileLayer extends TileLayer {
|
||||||
|
|
||||||
|
private final static int MAX_CACHE = 32;
|
||||||
|
|
||||||
|
private final static int MIN_ZOOM = 16;
|
||||||
|
private final static int MAX_ZOOM = 16;
|
||||||
|
|
||||||
|
private final TileSource mTileSource;
|
||||||
|
|
||||||
|
public S3DBTileLayer(Map map, TileSource tileSource) {
|
||||||
|
this(map, tileSource, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple-3D-Buildings OSCIM4 Tile Layer
|
||||||
|
*
|
||||||
|
* @param map Stored map workaround
|
||||||
|
* @param tileSource Source of loaded tiles in {@link org.oscim.layers.tile.vector.VectorTileLayer}
|
||||||
|
* @param fxaa Switch on Fast Approximate Anti-Aliasing
|
||||||
|
* @param ssao Switch on Screen Space Ambient Occlusion
|
||||||
|
*/
|
||||||
|
public S3DBTileLayer(Map map, TileSource tileSource, boolean fxaa, boolean ssao) {
|
||||||
|
super(map, new TileManager(map, MAX_CACHE));
|
||||||
|
setRenderer(new S3DBTileRenderer(fxaa, ssao));
|
||||||
|
|
||||||
|
mTileManager.setZoomLevel(MIN_ZOOM, MAX_ZOOM);
|
||||||
|
mTileSource = tileSource;
|
||||||
|
initLoader(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected S3DBTileLoader createLoader() {
|
||||||
|
return new S3DBTileLoader(getManager(), mTileSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class S3DBTileRenderer extends TileRenderer {
|
||||||
|
LayerRenderer mRenderer;
|
||||||
|
|
||||||
|
public S3DBTileRenderer(boolean fxaa, boolean ssao) {
|
||||||
|
mRenderer = new BuildingRenderer(this, MIN_ZOOM, MAX_ZOOM, true, false);
|
||||||
|
|
||||||
|
if (fxaa || ssao) {
|
||||||
|
Mode mode = Mode.FXAA;
|
||||||
|
if (fxaa && ssao)
|
||||||
|
mode = Mode.SSAO_FXAA;
|
||||||
|
else if (ssao)
|
||||||
|
mode = Mode.SSAO;
|
||||||
|
mRenderer = new OffscreenRenderer(mode, mRenderer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void update(GLViewport v) {
|
||||||
|
super.update(v);
|
||||||
|
mRenderer.update(v);
|
||||||
|
setReady(mRenderer.isReady());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void render(GLViewport v) {
|
||||||
|
mRenderer.render(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setup() {
|
||||||
|
mRenderer.setup();
|
||||||
|
return super.setup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,6 @@ import org.oscim.backend.canvas.Color;
|
|||||||
import org.oscim.core.GeometryBuffer;
|
import org.oscim.core.GeometryBuffer;
|
||||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||||
import org.oscim.core.MapElement;
|
import org.oscim.core.MapElement;
|
||||||
import org.oscim.core.MercatorProjection;
|
|
||||||
import org.oscim.core.Tag;
|
import org.oscim.core.Tag;
|
||||||
import org.oscim.layers.tile.MapTile;
|
import org.oscim.layers.tile.MapTile;
|
||||||
import org.oscim.layers.tile.TileLoader;
|
import org.oscim.layers.tile.TileLoader;
|
||||||
@@ -96,9 +95,7 @@ class S3DBTileLoader extends TileLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initTile(MapTile tile) {
|
private void initTile(MapTile tile) {
|
||||||
double lat = MercatorProjection.toLatitude(tile.y);
|
mGroundScale = tile.getGroundScale();
|
||||||
mGroundScale = (float) MercatorProjection
|
|
||||||
.groundResolutionWithScale(lat, 1 << mTile.zoomLevel);
|
|
||||||
|
|
||||||
mRoofs = new ExtrusionBucket(0, mGroundScale, Color.get(247, 249, 250));
|
mRoofs = new ExtrusionBucket(0, mGroundScale, Color.get(247, 249, 250));
|
||||||
|
|
||||||
@@ -106,7 +103,7 @@ class S3DBTileLoader extends TileLoader {
|
|||||||
//mRoofs = new ExtrusionLayer(0, mGroundScale, Color.get(207, 209, 210));
|
//mRoofs = new ExtrusionLayer(0, mGroundScale, Color.get(207, 209, 210));
|
||||||
mRoofs.next = mParts;
|
mRoofs.next = mParts;
|
||||||
|
|
||||||
BuildingLayer.get(tile).setBuckets(mRoofs);
|
BuildingLayer.get(tile).resetBuckets(mRoofs);
|
||||||
|
|
||||||
process(mTilePlane);
|
process(mTilePlane);
|
||||||
}
|
}
|
||||||
@@ -128,26 +125,27 @@ class S3DBTileLoader extends TileLoader {
|
|||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
if (element.tags.containsKey(OSCIM4_KEY_COLOR)) {
|
if (element.tags.containsKey(OSCIM4_KEY_COLOR)) {
|
||||||
c = S3DBLayer.getColor(element.tags.getValue(OSCIM4_KEY_COLOR), isRoof);
|
c = S3DBUtils.getColor(element.tags.getValue(OSCIM4_KEY_COLOR), isRoof);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == 0 && element.tags.containsKey(OSCIM4_KEY_MATERIAL)) {
|
if (c == 0 && element.tags.containsKey(OSCIM4_KEY_MATERIAL)) {
|
||||||
c = S3DBLayer.getMaterialColor(element.tags.getValue(OSCIM4_KEY_MATERIAL), isRoof);
|
c = S3DBUtils.getMaterialColor(element.tags.getValue(OSCIM4_KEY_MATERIAL), isRoof);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
String roofShape = element.tags.getValue(Tag.KEY_ROOF_SHAPE);
|
String roofShape = element.tags.getValue(Tag.KEY_ROOF_SHAPE);
|
||||||
|
|
||||||
if (isRoof && (roofShape == null || Tag.VALUE_FLAT.equals(roofShape)))
|
if (isRoof && (roofShape == null || Tag.VALUE_FLAT.equals(roofShape)))
|
||||||
mRoofs.add(element);
|
mRoofs.addMesh(element);
|
||||||
else
|
else
|
||||||
mParts.add(element);
|
mParts.addMesh(element);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// May replace with ExtrusionBucket.addMeshElement()
|
||||||
for (ExtrusionBucket l = mParts; l != null; l = l.next()) {
|
for (ExtrusionBucket l = mParts; l != null; l = l.next()) {
|
||||||
if (l.color == c) {
|
if (l.getColor() == c) {
|
||||||
l.add(element);
|
l.addMesh(element);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +154,7 @@ class S3DBTileLoader extends TileLoader {
|
|||||||
l.next = mParts.next;
|
l.next = mParts.next;
|
||||||
mParts.next = l;
|
mParts.next = l;
|
||||||
|
|
||||||
l.add(element);
|
l.addMesh(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2017 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -17,96 +18,27 @@
|
|||||||
package org.oscim.layers.tile.buildings;
|
package org.oscim.layers.tile.buildings;
|
||||||
|
|
||||||
import org.oscim.backend.canvas.Color;
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.layers.tile.TileLayer;
|
|
||||||
import org.oscim.layers.tile.TileManager;
|
|
||||||
import org.oscim.layers.tile.TileRenderer;
|
|
||||||
import org.oscim.map.Map;
|
|
||||||
import org.oscim.renderer.GLViewport;
|
|
||||||
import org.oscim.renderer.LayerRenderer;
|
|
||||||
import org.oscim.renderer.OffscreenRenderer;
|
|
||||||
import org.oscim.renderer.OffscreenRenderer.Mode;
|
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.utils.ColorUtil;
|
import org.oscim.utils.ColorUtil;
|
||||||
import org.oscim.utils.ColorsCSS;
|
import org.oscim.utils.ColorsCSS;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class S3DBLayer extends TileLayer {
|
/**
|
||||||
static final Logger log = LoggerFactory.getLogger(S3DBLayer.class);
|
* Provides utils for S3DB layers.
|
||||||
|
*/
|
||||||
private final static int MAX_CACHE = 32;
|
public final class S3DBUtils {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(S3DBUtils.class);
|
||||||
private final static int MIN_ZOOM = 16;
|
|
||||||
private final static int MAX_ZOOM = 16;
|
|
||||||
|
|
||||||
/* TODO get from theme */
|
/* TODO get from theme */
|
||||||
private final static double HSV_S = 0.7;
|
private final static double HSV_S = 0.7;
|
||||||
private final static double HSV_V = 1.2;
|
private final static double HSV_V = 1.2;
|
||||||
|
|
||||||
private final TileSource mTileSource;
|
|
||||||
|
|
||||||
public S3DBLayer(Map map, TileSource tileSource) {
|
|
||||||
this(map, tileSource, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple-3D-Buildings OSCIM4 Tile Layer
|
* @param color the color as string (see http://wiki.openstreetmap.org/wiki/Key:colour)
|
||||||
*
|
* @param roof declare if color is used for roofs
|
||||||
* @param map Stored map workaround
|
* @return the color as integer (8 bit each a, r, g, b)
|
||||||
* @param tileSource Source of loaded tiles in {@link org.oscim.layers.tile.vector.VectorTileLayer}
|
|
||||||
* @param fxaa Switch on Fast Approximate Anti-Aliasing
|
|
||||||
* @param ssao Switch on Screen Space Ambient Occlusion
|
|
||||||
*/
|
*/
|
||||||
public S3DBLayer(Map map, TileSource tileSource, boolean fxaa, boolean ssao) {
|
public static int getColor(String color, boolean roof) {
|
||||||
super(map, new TileManager(map, MAX_CACHE));
|
|
||||||
setRenderer(new S3DBRenderer(fxaa, ssao));
|
|
||||||
|
|
||||||
mTileManager.setZoomLevel(MIN_ZOOM, MAX_ZOOM);
|
|
||||||
mTileSource = tileSource;
|
|
||||||
initLoader(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected S3DBTileLoader createLoader() {
|
|
||||||
return new S3DBTileLoader(getManager(), mTileSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class S3DBRenderer extends TileRenderer {
|
|
||||||
LayerRenderer mRenderer;
|
|
||||||
|
|
||||||
public S3DBRenderer(boolean fxaa, boolean ssao) {
|
|
||||||
mRenderer = new BuildingRenderer(this, MIN_ZOOM, MAX_ZOOM, true, false);
|
|
||||||
|
|
||||||
if (fxaa || ssao) {
|
|
||||||
Mode mode = Mode.FXAA;
|
|
||||||
if (fxaa && ssao)
|
|
||||||
mode = Mode.SSAO_FXAA;
|
|
||||||
else if (ssao)
|
|
||||||
mode = Mode.SSAO;
|
|
||||||
mRenderer = new OffscreenRenderer(mode, mRenderer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void update(GLViewport v) {
|
|
||||||
super.update(v);
|
|
||||||
mRenderer.update(v);
|
|
||||||
setReady(mRenderer.isReady());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void render(GLViewport v) {
|
|
||||||
mRenderer.render(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean setup() {
|
|
||||||
mRenderer.setup();
|
|
||||||
return super.setup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int getColor(String color, boolean roof) {
|
|
||||||
|
|
||||||
if (color.charAt(0) == '#') {
|
if (color.charAt(0) == '#') {
|
||||||
int c = Color.parseColor(color, Color.CYAN);
|
int c = Color.parseColor(color, Color.CYAN);
|
||||||
@@ -155,7 +87,12 @@ public class S3DBLayer extends TileLayer {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getMaterialColor(String material, boolean roof) {
|
/**
|
||||||
|
* @param material the material as string (see http://wiki.openstreetmap.org/wiki/Key:material and following pages)
|
||||||
|
* @param roof declare if material is used for roofs
|
||||||
|
* @return the color as integer (8 bit each a, r, g, b)
|
||||||
|
*/
|
||||||
|
public static int getMaterialColor(String material, boolean roof) {
|
||||||
|
|
||||||
if (roof) {
|
if (roof) {
|
||||||
if ("glass".equals(material))
|
if ("glass".equals(material))
|
||||||
@@ -210,4 +147,7 @@ public class S3DBLayer extends TileLayer {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private S3DBUtils() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2017 Izumi Kawashima
|
||||||
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -38,13 +40,15 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
protected int mBucketsCnt;
|
protected int mBucketsCnt;
|
||||||
protected float mAlpha = 1;
|
protected float mAlpha = 1;
|
||||||
|
|
||||||
|
private float mZLimit = Float.MAX_VALUE;
|
||||||
|
|
||||||
public ExtrusionRenderer(boolean mesh, boolean alpha) {
|
public ExtrusionRenderer(boolean mesh, boolean alpha) {
|
||||||
mMode = mesh ? 1 : 0;
|
mMode = mesh ? 1 : 0;
|
||||||
mTranslucent = alpha;
|
mTranslucent = alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Shader extends GLShader {
|
public static class Shader extends GLShader {
|
||||||
int uMVP, uColor, uAlpha, uMode, aPos, aLight;
|
int uMVP, uColor, uAlpha, uMode, aPos, aLight, uZLimit;
|
||||||
|
|
||||||
public Shader(String shader) {
|
public Shader(String shader) {
|
||||||
if (!create(shader))
|
if (!create(shader))
|
||||||
@@ -54,6 +58,7 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
uColor = getUniform("u_color");
|
uColor = getUniform("u_color");
|
||||||
uAlpha = getUniform("u_alpha");
|
uAlpha = getUniform("u_alpha");
|
||||||
uMode = getUniform("u_mode");
|
uMode = getUniform("u_mode");
|
||||||
|
uZLimit = getUniform("u_zlimit");
|
||||||
aPos = getAttrib("a_pos");
|
aPos = getAttrib("a_pos");
|
||||||
aLight = getAttrib("a_light");
|
aLight = getAttrib("a_light");
|
||||||
}
|
}
|
||||||
@@ -95,7 +100,7 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
@Override
|
@Override
|
||||||
public void render(GLViewport v) {
|
public void render(GLViewport v) {
|
||||||
|
|
||||||
float[] currentColor = null;
|
float[] currentColors = null;
|
||||||
float currentAlpha = 0;
|
float currentAlpha = 0;
|
||||||
|
|
||||||
gl.depthMask(true);
|
gl.depthMask(true);
|
||||||
@@ -114,6 +119,7 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
|
|
||||||
gl.depthFunc(GL.LESS);
|
gl.depthFunc(GL.LESS);
|
||||||
gl.uniform1f(s.uAlpha, mAlpha);
|
gl.uniform1f(s.uAlpha, mAlpha);
|
||||||
|
gl.uniform1f(s.uZLimit, mZLimit);
|
||||||
|
|
||||||
ExtrusionBuckets[] ebs = mExtrusionBucketSet;
|
ExtrusionBuckets[] ebs = mExtrusionBucketSet;
|
||||||
|
|
||||||
@@ -171,11 +177,11 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
|
|
||||||
for (; eb != null; eb = eb.next()) {
|
for (; eb != null; eb = eb.next()) {
|
||||||
|
|
||||||
if (eb.colors != currentColor) {
|
if (eb.getColors() != currentColors) {
|
||||||
currentColor = eb.colors;
|
currentColors = eb.getColors();
|
||||||
GLUtils.glUniform4fv(s.uColor,
|
GLUtils.glUniform4fv(s.uColor,
|
||||||
mMode == 0 ? 4 : 1,
|
mMode == 0 ? 4 : 1,
|
||||||
eb.colors);
|
currentColors);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.vertexAttribPointer(s.aPos, 3, GL.SHORT,
|
gl.vertexAttribPointer(s.aPos, 3, GL.SHORT,
|
||||||
@@ -268,4 +274,8 @@ public abstract class ExtrusionRenderer extends LayerRenderer {
|
|||||||
}
|
}
|
||||||
v.mvp.setAsUniform(s.uMVP);
|
v.mvp.setAsUniform(s.uMVP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setZLimit(float zLimit) {
|
||||||
|
mZLimit = zLimit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, 2013 Hannes Janetzek
|
* Copyright 2012, 2013 Hannes Janetzek
|
||||||
|
* Copyright 2017 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -18,8 +19,6 @@ package org.oscim.renderer.bucket;
|
|||||||
|
|
||||||
import org.oscim.backend.canvas.Color;
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.core.GeometryBuffer;
|
import org.oscim.core.GeometryBuffer;
|
||||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
|
||||||
import org.oscim.core.MapElement;
|
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.utils.FastMath;
|
import org.oscim.utils.FastMath;
|
||||||
import org.oscim.utils.KeyMap;
|
import org.oscim.utils.KeyMap;
|
||||||
@@ -43,13 +42,14 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
/**
|
/**
|
||||||
* 16 floats rgba for top, even-side, odd-sides and outline
|
* 16 floats rgba for top, even-side, odd-sides and outline
|
||||||
*/
|
*/
|
||||||
public final float[] colors;
|
private final float[] colors;
|
||||||
public final int color;
|
private final int color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* indices for: 0. even sides, 1. odd sides, 2. roof, 3. roof outline
|
* indices for: 0. even sides, 1. odd sides, 2. roof, 3. roof outline
|
||||||
*/
|
*/
|
||||||
public int idx[] = {0, 0, 0, 0, 0};
|
public int idx[] = {0, 0, 0, 0, 0};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* indices offsets in bytes
|
* indices offsets in bytes
|
||||||
*/
|
*/
|
||||||
@@ -90,7 +90,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExtrusionLayer for triangle geometries.
|
* ExtrusionLayer for triangle geometries / meshes.
|
||||||
*/
|
*/
|
||||||
public ExtrusionBucket(int level, float groundResolution, int color) {
|
public ExtrusionBucket(int level, float groundResolution, int color) {
|
||||||
super(RenderBucket.EXTRUSION, true, false);
|
super(RenderBucket.EXTRUSION, true, false);
|
||||||
@@ -98,7 +98,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
this.color = color;
|
this.color = color;
|
||||||
|
|
||||||
float a = Color.aToFloat(color);
|
float a = Color.aToFloat(color);
|
||||||
colors = new float[4];
|
colors = new float[4]; // Why not 16?
|
||||||
colors[0] = a * Color.rToFloat(color);
|
colors[0] = a * Color.rToFloat(color);
|
||||||
colors[1] = a * Color.gToFloat(color);
|
colors[1] = a * Color.gToFloat(color);
|
||||||
colors[2] = a * Color.bToFloat(color);
|
colors[2] = a * Color.bToFloat(color);
|
||||||
@@ -152,8 +152,13 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(MapElement element) {
|
/**
|
||||||
if (element.type != GeometryType.TRIS)
|
* Add MapElement which provides meshes
|
||||||
|
*
|
||||||
|
* @param element the map element to add
|
||||||
|
*/
|
||||||
|
public void addMesh(GeometryBuffer element) {
|
||||||
|
if (!element.isTris())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int[] index = element.index;
|
int[] index = element.index;
|
||||||
@@ -165,6 +170,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
Vertex key = vertexPool.get();
|
Vertex key = vertexPool.get();
|
||||||
double scale = COORD_SCALE * Tile.SIZE / 4096;
|
double scale = COORD_SCALE * Tile.SIZE / 4096;
|
||||||
|
|
||||||
|
// n is introduced if length increases while processing
|
||||||
for (int k = 0, n = index.length; k < n; ) {
|
for (int k = 0, n = index.length; k < n; ) {
|
||||||
if (index[k] < 0)
|
if (index[k] < 0)
|
||||||
break;
|
break;
|
||||||
@@ -173,6 +179,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
if (vertexCnt >= 1 << 16)
|
if (vertexCnt >= 1 << 16)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Get position of points for each polygon (which always has 3 points)
|
||||||
int vtx1 = index[k++] * 3;
|
int vtx1 = index[k++] * 3;
|
||||||
int vtx2 = index[k++] * 3;
|
int vtx2 = index[k++] * 3;
|
||||||
int vtx3 = index[k++] * 3;
|
int vtx3 = index[k++] * 3;
|
||||||
@@ -189,6 +196,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
float vy3 = points[vtx3 + 1];
|
float vy3 = points[vtx3 + 1];
|
||||||
float vz3 = points[vtx3 + 2];
|
float vz3 = points[vtx3 + 2];
|
||||||
|
|
||||||
|
// Calculate normal for color gradient
|
||||||
float ax = vx2 - vx1;
|
float ax = vx2 - vx1;
|
||||||
float ay = vy2 - vy1;
|
float ay = vy2 - vy1;
|
||||||
float az = vz2 - vz1;
|
float az = vz2 - vz1;
|
||||||
@@ -197,6 +205,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
float by = vy3 - vy1;
|
float by = vy3 - vy1;
|
||||||
float bz = vz3 - vz1;
|
float bz = vz3 - vz1;
|
||||||
|
|
||||||
|
// Vector product (c is at right angle to a and b)
|
||||||
float cx = ay * bz - az * by;
|
float cx = ay * bz - az * by;
|
||||||
float cy = az * bx - ax * bz;
|
float cy = az * bx - ax * bz;
|
||||||
float cz = ax * by - ay * bx;
|
float cz = ax * by - ay * bx;
|
||||||
@@ -225,11 +234,11 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
|
|
||||||
if (vertex == null) {
|
if (vertex == null) {
|
||||||
key.id = vertexCnt++;
|
key.id = vertexCnt++;
|
||||||
addIndex(key, true);
|
addMeshIndex(key, true);
|
||||||
key = vertexPool.get();
|
key = vertexPool.get();
|
||||||
} else {
|
} else {
|
||||||
//numIndexHits++;
|
//numIndexHits++;
|
||||||
addIndex(vertex, false);
|
addMeshIndex(vertex, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
key.set((short) (vx2 * scale),
|
key.set((short) (vx2 * scale),
|
||||||
@@ -241,11 +250,11 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
|
|
||||||
if (vertex == null) {
|
if (vertex == null) {
|
||||||
key.id = vertexCnt++;
|
key.id = vertexCnt++;
|
||||||
addIndex(key, true);
|
addMeshIndex(key, true);
|
||||||
key = vertexPool.get();
|
key = vertexPool.get();
|
||||||
} else {
|
} else {
|
||||||
//numIndexHits++;
|
//numIndexHits++;
|
||||||
addIndex(vertex, false);
|
addMeshIndex(vertex, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
key.set((short) (vx3 * scale),
|
key.set((short) (vx3 * scale),
|
||||||
@@ -256,11 +265,11 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
vertex = mVertexMap.put(key, false);
|
vertex = mVertexMap.put(key, false);
|
||||||
if (vertex == null) {
|
if (vertex == null) {
|
||||||
key.id = vertexCnt++;
|
key.id = vertexCnt++;
|
||||||
addIndex(key, true);
|
addMeshIndex(key, true);
|
||||||
key = vertexPool.get();
|
key = vertexPool.get();
|
||||||
} else {
|
} else {
|
||||||
//numIndexHits++;
|
//numIndexHits++;
|
||||||
addIndex(vertex, false);
|
addMeshIndex(vertex, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +278,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
numVertices = vertexCnt;
|
numVertices = vertexCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIndex(Vertex v, boolean addVertex) {
|
private void addMeshIndex(Vertex v, boolean addVertex) {
|
||||||
if (addVertex)
|
if (addVertex)
|
||||||
vertexItems.add(v.x, v.y, v.z, v.n);
|
vertexItems.add(v.x, v.y, v.z, v.n);
|
||||||
|
|
||||||
@@ -339,7 +348,14 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
// sumVertices += (vertexCnt / 3);
|
// sumVertices += (vertexCnt / 3);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public void add(MapElement element, float height, float minHeight) {
|
/**
|
||||||
|
* Add MapElement which provides polygons
|
||||||
|
*
|
||||||
|
* @param element the map element to add
|
||||||
|
* @param height the maximum height of element
|
||||||
|
* @param minHeight the minimum height of element
|
||||||
|
*/
|
||||||
|
public void addPoly(GeometryBuffer element, float height, float minHeight) {
|
||||||
|
|
||||||
int[] index = element.index;
|
int[] index = element.index;
|
||||||
float[] points = element.points;
|
float[] points = element.points;
|
||||||
@@ -383,7 +399,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
log.debug("explicit closed poly " + len);
|
log.debug("explicit closed poly " + len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* need at least three points */
|
/* need at least three points (x and y) */
|
||||||
if (len < 6)
|
if (len < 6)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -429,6 +445,7 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
int numRings = 0;
|
int numRings = 0;
|
||||||
|
|
||||||
/* get sum of points in polygon */
|
/* get sum of points in polygon */
|
||||||
|
// n is introduced if length increases while processing
|
||||||
for (int i = ipos, n = index.length; i < n && index[i] > 0; i++) {
|
for (int i = ipos, n = index.length; i < n && index[i] > 0; i++) {
|
||||||
numPoints += index[i];
|
numPoints += index[i];
|
||||||
numRings++;
|
numRings++;
|
||||||
@@ -615,6 +632,20 @@ public class ExtrusionBucket extends RenderBucket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the polygon colors (top, side, side, line)
|
||||||
|
*/
|
||||||
|
public float[] getColors() {
|
||||||
|
return colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the mesh color
|
||||||
|
*/
|
||||||
|
public int getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void prepare() {
|
protected void prepare() {
|
||||||
mClipper = null;
|
mClipper = null;
|
||||||
|
|||||||
@@ -1,10 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Hannes Janetzek
|
||||||
|
* Copyright 2017 Gustl22
|
||||||
|
*
|
||||||
|
* 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.renderer.bucket;
|
package org.oscim.renderer.bucket;
|
||||||
|
|
||||||
import org.oscim.backend.GL;
|
import org.oscim.backend.GL;
|
||||||
|
import org.oscim.core.GeometryBuffer;
|
||||||
import org.oscim.layers.tile.MapTile;
|
import org.oscim.layers.tile.MapTile;
|
||||||
import org.oscim.layers.tile.MapTile.TileData;
|
import org.oscim.layers.tile.MapTile.TileData;
|
||||||
import org.oscim.renderer.BufferObject;
|
import org.oscim.renderer.BufferObject;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
|
import org.oscim.utils.pool.Inlist;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -33,22 +52,71 @@ public class ExtrusionBuckets extends TileData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set new ExtrusionLayers and clear previous.
|
* Add mesh element to corresponding ExtrusionBucket
|
||||||
|
*
|
||||||
|
* @param element the MapElement as mesh
|
||||||
|
* @param groundScale the scale of ground
|
||||||
|
* @param color the color of element
|
||||||
*/
|
*/
|
||||||
public void setBuckets(ExtrusionBucket el) {
|
public void addMeshElement(GeometryBuffer element, float groundScale, int color) {
|
||||||
|
// Add to bucket which has same color
|
||||||
|
for (ExtrusionBucket eb = this.buckets; eb != null; eb = eb.next()) {
|
||||||
|
if (eb.getColor() == color) {
|
||||||
|
eb.addMesh(element);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add to new bucket with different color
|
||||||
|
ExtrusionBucket eb = new ExtrusionBucket(0, groundScale, color);
|
||||||
|
this.buckets = Inlist.push(this.buckets, eb);
|
||||||
|
this.buckets.addMesh(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add poly element to corresponding ExtrusionBucket
|
||||||
|
*
|
||||||
|
* @param element the MapElement as polygon
|
||||||
|
* @param groundScale the scale of ground
|
||||||
|
* @param colors the colors (top, side, side, line) of element
|
||||||
|
* @param height the height of extrusion
|
||||||
|
* @param minHeight the minimum height of extrusion
|
||||||
|
*/
|
||||||
|
public void addPolyElement(GeometryBuffer element, float groundScale, float[] colors, int height, int minHeight) {
|
||||||
|
// Add to bucket which has same color
|
||||||
|
for (ExtrusionBucket eb = this.buckets; eb != null; eb = eb.next()) {
|
||||||
|
if (eb.getColors() == colors) {
|
||||||
|
eb.addPoly(element, height, minHeight);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add to new bucket with different color
|
||||||
|
ExtrusionBucket eb = new ExtrusionBucket(0, groundScale, colors);
|
||||||
|
this.buckets = Inlist.push(this.buckets, eb);
|
||||||
|
this.buckets.addPoly(element, height, minHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set new ExtrusionBuckets and clear previous.
|
||||||
|
*/
|
||||||
|
public void resetBuckets(ExtrusionBucket el) {
|
||||||
for (RenderBucket b = buckets; b != null; b = b.next)
|
for (RenderBucket b = buckets; b != null; b = b.next)
|
||||||
b.clear();
|
b.clear();
|
||||||
|
|
||||||
buckets = el;
|
buckets = el;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get root bucket
|
||||||
|
*/
|
||||||
public ExtrusionBucket buckets() {
|
public ExtrusionBucket buckets() {
|
||||||
return buckets;
|
return buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dispose() {
|
protected void dispose() {
|
||||||
setBuckets(null);
|
resetBuckets(null);
|
||||||
|
|
||||||
if (compiled) {
|
if (compiled) {
|
||||||
ibo = BufferObject.release(ibo);
|
ibo = BufferObject.release(ibo);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class MeshBucket extends RenderBucket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addMesh(GeometryBuffer geom) {
|
public void addMesh(GeometryBuffer geom) {
|
||||||
numPoints += geom.pointPos;
|
numPoints += geom.pointNextPos;
|
||||||
if (tess == null)
|
if (tess == null)
|
||||||
tess = new TessJNI(8);
|
tess = new TessJNI(8);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2017 ale5000
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -97,19 +98,19 @@ public class LwHttp implements HttpEngine {
|
|||||||
|
|
||||||
StringBuilder sb = new StringBuilder()
|
StringBuilder sb = new StringBuilder()
|
||||||
.append(" HTTP/1.1")
|
.append(" HTTP/1.1")
|
||||||
.append("\nUser-Agent: vtm/0.5.9")
|
.append("\r\nUser-Agent: vtm/0.5.9")
|
||||||
.append("\nHost: ")
|
.append("\r\nHost: ")
|
||||||
.append(mHost)
|
.append(mHost)
|
||||||
.append("\nConnection: Keep-Alive");
|
.append("\r\nConnection: Keep-Alive");
|
||||||
|
|
||||||
for (Entry<String, String> l : tileSource.getRequestHeader().entrySet()) {
|
for (Entry<String, String> l : tileSource.getRequestHeader().entrySet()) {
|
||||||
String key = l.getKey();
|
String key = l.getKey();
|
||||||
String val = l.getValue();
|
String val = l.getValue();
|
||||||
//if ("Accept-Encoding".equals(key) && "gzip".equals(val))
|
//if ("Accept-Encoding".equals(key) && "gzip".equals(val))
|
||||||
// mUseGZIP = true;
|
// mUseGZIP = true;
|
||||||
sb.append('\n').append(key).append(": ").append(val);
|
sb.append("\r\n").append(key).append(": ").append(val);
|
||||||
}
|
}
|
||||||
sb.append("\n\n");
|
sb.append("\r\n\r\n");
|
||||||
|
|
||||||
REQUEST_GET_END = sb.toString().getBytes();
|
REQUEST_GET_END = sb.toString().getBytes();
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public abstract class PbfDecoder implements ITileDecoder {
|
|||||||
|
|
||||||
bufferPos = pos;
|
bufferPos = pos;
|
||||||
|
|
||||||
geom.pointPos = cnt;
|
geom.pointNextPos = cnt;
|
||||||
|
|
||||||
// return number of points read
|
// return number of points read
|
||||||
return (cnt >> 1);
|
return (cnt >> 1);
|
||||||
|
|||||||
@@ -723,8 +723,8 @@ public class MapDatabase implements ITileDataSource {
|
|||||||
int[] buffer = mIntBuffer;
|
int[] buffer = mIntBuffer;
|
||||||
mReadBuffer.readSignedInt(buffer, length);
|
mReadBuffer.readSignedInt(buffer, length);
|
||||||
|
|
||||||
float[] outBuffer = e.ensurePointSize(e.pointPos + length, true);
|
float[] outBuffer = e.ensurePointSize(e.pointNextPos + length, true);
|
||||||
int outPos = e.pointPos;
|
int outPos = e.pointNextPos;
|
||||||
int lat, lon;
|
int lat, lon;
|
||||||
|
|
||||||
/* first node latitude single-delta offset */
|
/* first node latitude single-delta offset */
|
||||||
@@ -772,7 +772,7 @@ public class MapDatabase implements ITileDataSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.pointPos = outPos;
|
e.pointNextPos = outPos;
|
||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ public class TileDecoder extends PbfDecoder {
|
|||||||
Integer.valueOf(cnt));
|
Integer.valueOf(cnt));
|
||||||
fail = true;
|
fail = true;
|
||||||
}
|
}
|
||||||
mElem.pointPos = cnt;
|
mElem.pointNextPos = cnt;
|
||||||
} else {
|
} else {
|
||||||
mElem.ensurePointSize(coordCnt, false);
|
mElem.ensurePointSize(coordCnt, false);
|
||||||
int cnt = decodeInterleavedPoints(mElem, mScaleFactor);
|
int cnt = decodeInterleavedPoints(mElem, mScaleFactor);
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ public class SimplifyVW {
|
|||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
if (heap.length < geom.pointPos >> 1)
|
if (heap.length < geom.pointNextPos >> 1)
|
||||||
heap = new Item[geom.pointPos >> 1];
|
heap = new Item[geom.pointNextPos >> 1];
|
||||||
|
|
||||||
first = prev = push(0, Float.MAX_VALUE);
|
first = prev = push(0, Float.MAX_VALUE);
|
||||||
|
|
||||||
for (int i = 2; i < geom.pointPos - 2; i += 2) {
|
for (int i = 2; i < geom.pointNextPos - 2; i += 2) {
|
||||||
it = push(i, area(geom.points, i - 2, i, i + 2));
|
it = push(i, area(geom.points, i - 2, i, i + 2));
|
||||||
prev.next = it;
|
prev.next = it;
|
||||||
it.prev = prev;
|
it.prev = prev;
|
||||||
@@ -67,7 +67,7 @@ public class SimplifyVW {
|
|||||||
prev = it;
|
prev = it;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item last = push(geom.pointPos - 2, Float.MAX_VALUE);
|
Item last = push(geom.pointNextPos - 2, Float.MAX_VALUE);
|
||||||
|
|
||||||
// sorter.doSort(heap, DistanceComparator, 0, size);
|
// sorter.doSort(heap, DistanceComparator, 0, size);
|
||||||
// for (int i = 0; i < size; i++)
|
// for (int i = 0; i < size; i++)
|
||||||
@@ -102,8 +102,8 @@ public class SimplifyVW {
|
|||||||
first.prev = null;
|
first.prev = null;
|
||||||
it = first;
|
it = first;
|
||||||
|
|
||||||
float[] points = new float[geom.pointPos];
|
float[] points = new float[geom.pointNextPos];
|
||||||
System.arraycopy(geom.points, 0, points, 0, geom.pointPos);
|
System.arraycopy(geom.points, 0, points, 0, geom.pointNextPos);
|
||||||
|
|
||||||
geom.clear();
|
geom.clear();
|
||||||
geom.startPolygon();
|
geom.startPolygon();
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class TileClipper {
|
|||||||
|
|
||||||
clipEdge(out, geom, LineClipper.BOTTOM);
|
clipEdge(out, geom, LineClipper.BOTTOM);
|
||||||
|
|
||||||
if ((geom.indexPos == 0) && (geom.index[0] < 6))
|
if ((geom.indexCurrentPos == 0) && (geom.index[0] < 6))
|
||||||
return false;
|
return false;
|
||||||
} else if (geom.isLine()) {
|
} else if (geom.isLine()) {
|
||||||
|
|
||||||
@@ -81,12 +81,12 @@ public class TileClipper {
|
|||||||
System.arraycopy(out.index, 0, idx, 0, numLines);
|
System.arraycopy(out.index, 0, idx, 0, numLines);
|
||||||
geom.index[numLines] = -1;
|
geom.index[numLines] = -1;
|
||||||
|
|
||||||
float pts[] = geom.ensurePointSize(out.pointPos >> 1, false);
|
float pts[] = geom.ensurePointSize(out.pointNextPos >> 1, false);
|
||||||
System.arraycopy(out.points, 0, pts, 0, out.pointPos);
|
System.arraycopy(out.points, 0, pts, 0, out.pointNextPos);
|
||||||
geom.indexPos = out.indexPos;
|
geom.indexCurrentPos = out.indexCurrentPos;
|
||||||
geom.pointPos = out.pointPos;
|
geom.pointNextPos = out.pointNextPos;
|
||||||
|
|
||||||
if ((geom.indexPos == 0) && (geom.index[0] < 4))
|
if ((geom.indexCurrentPos == 0) && (geom.index[0] < 4))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user