Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map-9: Develop #691

Merged
merged 200 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
bc8051d
Improve setT handling
maerki Aug 26, 2024
545b20b
update tile loading logic
maerki Nov 10, 2024
5d95aef
load only 10 tiles in parallel to make sure the most important tiles …
simonroesch Nov 15, 2024
05935b2
fix mailbox memberFn hashing
simonroesch Nov 16, 2024
6b4290f
add dataMutex lock for Polygon2dOpenGl drawPolygon
simonroesch Nov 16, 2024
30435dc
improvements for time travel loading
simonroesch Nov 16, 2024
99f1957
setup animated dashes
maerki Dec 11, 2024
99345b9
correct parameter handling
maerki Dec 11, 2024
1fb66a3
adds arrayValue
zimmermannubique Dec 11, 2024
2883d8c
allow dotted line
maerki Dec 12, 2024
fd35aea
fix vector line style
maerki Dec 12, 2024
36da387
Merge pull request #662 from openmobilemaps/feature/animated-dashes
maerki Dec 12, 2024
c29d112
fix retry delay computation
maerki Dec 12, 2024
d61205a
improve time property
maerki Dec 12, 2024
d0c8609
Merge branch 'main' into develop
maerki Dec 12, 2024
6297567
Add missing line fixes
maerki Dec 12, 2024
47578ee
only render what’s visible
maerki Dec 16, 2024
6d27475
WIP: cmake build, maven pom, dummy code
matzf Sep 2, 2024
5cd7cbd
test code draws something
matzf Sep 2, 2024
b5edf34
Use OSMesa in Java, hacky fix for JNI dep in core
matzf Sep 2, 2024
443fa75
Add DataLoader and TextureHolder, somewhat working
matzf Sep 6, 2024
a802b71
Add fonts
matzf Sep 6, 2024
0dfc77c
Various cleanup
matzf Sep 9, 2024
4a106f3
Add map tiler and offscreen renderer abstractions
matzf Sep 16, 2024
57bc63f
Remove misc debug printf
matzf Sep 16, 2024
914bb3a
Add multisample anti-aliasing support
matzf Sep 16, 2024
a2bd7d3
Fix cleanup of FBO/RBO in OSMesa helper
matzf Sep 16, 2024
6b0273b
build: include platform string in native library filename
matzf Sep 19, 2024
86a5ee0
WIP
matzf Sep 23, 2024
0cd4f02
Reformat java and fix various warnings
matzf Sep 26, 2024
bd9f826
Trigger cmake build from maven, cleanup jvm/pom.xml
matzf Sep 27, 2024
9d85e8d
Remove old develop script
matzf Sep 27, 2024
c8edaa9
Add dummy definitions of android classes used in Djinni libraries
matzf Sep 27, 2024
1551f50
github: add workflow to build JVM lib with maven
matzf Sep 27, 2024
4b62ee8
github: try recursive submodule checkout from workflow feature branch
matzf Sep 27, 2024
4e7baa9
github: try maven deploy
matzf Sep 27, 2024
e32c2c2
github: try alt deploy repo in maven deploy workflow
matzf Sep 27, 2024
8019a3c
Font loader: load (only) from classpath resources
matzf Sep 30, 2024
ffc5ead
Add data loader for local resources (mainly for style.json)
matzf Sep 27, 2024
39535eb
Add timeout workaround for stuck map layers
matzf Sep 30, 2024
541b483
Update OffscreenMapRenderer to API change in 2.5.0
matzf Oct 1, 2024
cfe8f51
Turn develop script into simple JUnit test for OffscreenMapRenderer
matzf Oct 1, 2024
08f35e1
maven build: fix junit version, copy native lib for tests
matzf Oct 3, 2024
e4840fc
fixup: adapt to changed API after rebase
matzf Oct 8, 2024
babd2dc
fixup: update golden test images after rebase on 3.0.0, tiny differen…
matzf Oct 8, 2024
d1abce6
build both release and debug of .so for jar
matzf Oct 22, 2024
e7d27b6
java bindings: small fix for fontloader and info log level
matzf Oct 22, 2024
ede5e21
Java bindings: better builder for tiled2dmapvectorlayer, test with fonts
matzf Oct 28, 2024
5975873
Fix build after rebase
matzf Oct 28, 2024
a625284
Update golden files after rebase
matzf Oct 28, 2024
3b7a701
java: misc cleanup
matzf Oct 28, 2024
1d1ed0d
standalone demo/test cleanup
matzf Oct 30, 2024
770003a
CMake project split into sub-lists, add documentation
matzf Oct 30, 2024
f20688e
JVM pom fixup verision
matzf Oct 31, 2024
8c3f7df
Java bindings: expose custom HttpClient in Tiled2dMapVectorLayerBuilder
matzf Nov 1, 2024
ad4f517
Fixup typo
matzf Nov 1, 2024
c511f46
github: fixup on push tags syntax
matzf Nov 1, 2024
9c331ec
github: fixup version for package deploy workflow
matzf Nov 1, 2024
bff8643
Enable GL code paths with explicit define
matzf Nov 29, 2024
908162d
github: limit jvm build workflow to pull requests
matzf Dec 2, 2024
3aba96e
doc: fix trailing garbage in documentation bash line
matzf Dec 2, 2024
2ba1e31
Remove develop diagnostics gl error checks
matzf Dec 2, 2024
e5e7ed7
Remove left over printf
matzf Dec 2, 2024
e2130d3
jvm: deduplicate cmake execution configs in maven pom
matzf Dec 2, 2024
2b4bfc1
Fix: close stream when loading native library
matzf Dec 13, 2024
b143da8
Fix: check numSamples argument in OSMesa makeCurrent
matzf Dec 13, 2024
6223f3d
Fix: OsMesa exception RuntimeException not Error
matzf Dec 13, 2024
ed674e0
Fix: normalize path in LocalDataLoader to prevent directory traversal
matzf Dec 13, 2024
ee2f78a
Fix: close stream in LocalDataLoader
matzf Dec 13, 2024
a5bbd69
Fix: make MapTileRenderer tile size configurable
matzf Dec 13, 2024
ce65b92
Fix: throw IllegalStateException not AssertionException
matzf Dec 13, 2024
25dde8b
Fix: FontLoader better cache
matzf Dec 13, 2024
e0a4c2b
Fix: more robust error handling in HttpLoader
matzf Dec 16, 2024
d1127fa
Fix bug in OSMesa glReadPixels, use correct height
matzf Dec 16, 2024
c2159a1
Fix: add param checks to make the rabbit happy
matzf Dec 16, 2024
cbd0cd4
fixup! Add data loader for local resources (mainly for style.json)
matzf Dec 16, 2024
ebd3ae8
Fix build warnings after rebase
matzf Dec 16, 2024
c98a986
Fix: typo in readme
matzf Dec 16, 2024
6a10d06
Use SLF4J instead of util.logging.Logger
matzf Dec 16, 2024
2d7a8f2
Upate Kotlin version in JVM pom
matzf Dec 16, 2024
9fd5019
github: attempt to fix checkout by using sha instead of ref_name (<pr…
matzf Dec 16, 2024
488a609
Fix: explicitly include algorithm header
matzf Dec 16, 2024
2883946
Fix interia after two finger zoom
maerki Dec 16, 2024
421f2f7
zoom to corner instead of wrong bounding box for now
maerki Dec 16, 2024
116cd60
fixes bounding box movement
zimmermannubique Dec 17, 2024
74ed7bb
fixes zoom for meter width
zimmermannubique Dec 17, 2024
d5e48d9
fixes vpr problem
zimmermannubique Dec 17, 2024
1047632
fix deadlock
maerki Dec 17, 2024
b810b70
allow values of ValueEvaluators to be updated
stmitt Dec 17, 2024
32d72e6
fix m matrix
maerki Dec 17, 2024
ac672e5
cancel triangulation earlier if needed
maerki Dec 17, 2024
fcea8c2
iterate over symbols on inverse layers order on click
maerki Dec 18, 2024
e93a4be
Remove unused tempRes, leftover debug statement
matzf Dec 19, 2024
bd1d612
Cleanup left-over GL error checks
matzf Dec 19, 2024
62d73bc
Remove left-over include
matzf Dec 19, 2024
3b3315a
Merge branch 'develop' into feature/jvm-lib
matzf Dec 19, 2024
807b9ce
Merge pull request #652 from matzf/feature/jvm-lib
matzf Dec 19, 2024
be64c5c
correct enable_shared_from_this scope
maurhofer-ubique Dec 20, 2024
33754c0
Merge remote-tracking branch 'origin/feature/improve-time-loading' in…
maurhofer-ubique Dec 20, 2024
d1941d5
Fix number of line style shader arguments
maurhofer-ubique Dec 23, 2024
18ff1e4
Add sky sphere layer and shader (OpenGl), add getter for inverse vp m…
maurhofer-ubique Dec 27, 2024
9474b12
fix pinch initialize
maerki Dec 28, 2024
40cae44
Fix handling of vector layer feature dependent text-font properties
maurhofer-ubique Dec 30, 2024
65faf2c
Migrate from font map to vector
maurhofer-ubique Dec 31, 2024
700247a
Fix sky sphere texture sampling range
maurhofer-ubique Dec 31, 2024
5ed96ea
Update readme.md
eeppee-admin Jan 3, 2025
da87b14
Add interface for and implementations of a generic performance logger…
maurhofer-ubique Jan 6, 2025
093e50c
Merge pull request #668 from eeppee-admin/patch-1
maurhofer-ubique Jan 7, 2025
1cd0ab9
Move OpenGlPerformanceLoggerInterface and add non-OpenGL stub
maurhofer-ubique Jan 7, 2025
ebff3a3
Merge pull request #666 from openmobilemaps/feature/feature-dependent…
maurhofer-ubique Jan 7, 2025
1d252ea
Adjust ChronoUtil include
maurhofer-ubique Jan 7, 2025
7cccfdc
Adjust includes for GenericPerformanceLogger, adjust CMakeLists.txt f…
maurhofer-ubique Jan 7, 2025
c0c4a68
Merge pull request #670 from openmobilemaps/feature/performance-logger
maurhofer-ubique Jan 7, 2025
0c28e20
adds iOS SkySphereShader
stmitt Jan 7, 2025
4fa3dac
adds VectorModificationWrapper to only copy modified data to the GPU
stmitt Jan 9, 2025
e49011f
allow iconImage to be changed in the update method
stmitt Jan 9, 2025
d9e8348
remove duplicated file
stmitt Jan 9, 2025
25a1470
adds comment to explain usage
stmitt Jan 9, 2025
d16bddd
implement texture update for stretch icons
stmitt Jan 9, 2025
b6fc67d
Merge pull request #673 from openmobilemaps/feature/dynamic-icon-image
maurhofer-ubique Jan 9, 2025
8a523bf
Add specific levels option for vector layer style jsons
maurhofer-ubique Jan 13, 2025
8e1f45b
Fix map entry check in logger
maurhofer-ubique Jan 13, 2025
332d1b8
implements icon on line placement and text on line offset calculation
stmitt Jan 13, 2025
44212fc
Merge pull request #676 from openmobilemaps/feature/icon-line-placement
maurhofer-ubique Jan 13, 2025
65c802e
Add line selection scale factor
maurhofer-ubique Jan 13, 2025
500e29f
improve bordercase interactions
maerki Jan 12, 2025
d947407
follow touch at 90
maerki Jan 13, 2025
0257272
Fix view matrices function call
maurhofer-ubique Jan 13, 2025
4cb0b8c
last iterations
maerki Jan 14, 2025
3a9e444
adds a half float datatype to c++ used reduce memory when pushing dat…
stmitt Jan 14, 2025
a5c20f0
fixes a bug in the polygon pattern shader by sending half floats sinc…
stmitt Jan 14, 2025
d0f0744
Merge remote-tracking branch 'origin/main' into develop
stmitt Jan 14, 2025
22ca73e
lock the mailbox of the vector layer actor after creating it
stmitt Jan 14, 2025
2a226b0
Merge pull request #678 from openmobilemaps/bugfix/lock-mailbox
maurhofer-ubique Jan 14, 2025
d34ac34
JVM build: bump to non-ancient deploy plugin version to fix release w…
matzf Jan 6, 2025
85e9bb6
improve zoom level limit parsing
maerki Jan 15, 2025
d42ab86
Merge pull request #677 from openmobilemaps/feature/half-float
stmitt Jan 15, 2025
8f02217
Merge pull request #669 from openmobilemaps/feature/sky-sphere
maurhofer-ubique Jan 15, 2025
60ee4d4
max zoom 24 for layer, 22 for source
maerki Jan 15, 2025
f34a180
Merge pull request #679 from openmobilemaps/bugfix/improve-raster-zoo…
stmitt Jan 15, 2025
3921cb1
Handle null value in updateValue of ValueEvaluator
maurhofer-ubique Jan 15, 2025
9018d19
fixes heap overflow when setting positions
stmitt Jan 15, 2025
ea0e78f
Ensure setting vector layer symbols/text properties after setup
maurhofer-ubique Jan 15, 2025
fe9b27a
fixes hasNoValues calculation in Tiled2dMapVectorStateManager
stmitt Jan 17, 2025
e2e1f41
Merge branch 'release/3.0.0-rc.5' into develop
stmitt Jan 17, 2025
11590c7
Merge pull request #680 from openmobilemaps/bugfix/empty-state-manager
maurhofer-ubique Jan 20, 2025
c799464
adds vp_matrix and origin to compute shader call
stmitt Jan 20, 2025
957f8e4
remove double variable
stmitt Jan 20, 2025
f2586a4
Merge remote-tracking branch 'origin/main' into develop
stmitt Jan 20, 2025
7e3216a
Merge remote-tracking branch 'origin/feature/camera-3d-improvements' …
maurhofer-ubique Jan 21, 2025
252a19b
remove comment
stmitt Jan 21, 2025
0e687c2
remove printf in camer3d
stmitt Jan 21, 2025
6600921
setup for offscreen targets
maerki Jan 15, 2025
6b44d73
improve offscreen setup
maerki Jan 16, 2025
dee4c89
fix inset computation
maerki Jan 17, 2025
8b1b8f8
fix crash
maerki Jan 20, 2025
dc16c36
Use std::abs
maurhofer-ubique Jan 21, 2025
2be1d6d
Move simple layer target
maurhofer-ubique Jan 21, 2025
3ebb97f
Merge pull request #683 from openmobilemaps/feature/offscreen-render-…
maurhofer-ubique Jan 21, 2025
de4698f
add nearest-magnification option to raster layer, min,max zoom to web…
maerki Jan 22, 2025
b8587dc
offscreen target improvement
maerki Jan 22, 2025
a62eae3
Implement setMinMagFilter for Android Quads, add enum for filter type
maurhofer-ubique Jan 23, 2025
101f168
run djinni
stmitt Jan 23, 2025
3e3d8f4
fixes iOS quad
stmitt Jan 23, 2025
c712f2a
Fix dinni run
maurhofer-ubique Jan 23, 2025
d41e4c4
simplify mapUnitsFromPixels logic
stmitt Jan 23, 2025
8bc5e0b
remove log
stmitt Jan 23, 2025
f858657
fixes warnings
stmitt Jan 23, 2025
eff3a4d
Trigger update on cleared vector tiles
maurhofer-ubique Jan 31, 2025
0e583d9
fixes ready mgr starvation
stmitt Feb 3, 2025
58c03de
Merge pull request #684 from openmobilemaps/bugfix/ready-mgr-starvation
maurhofer-ubique Feb 3, 2025
f79cc9c
Merge pull request #685 from openmobilemaps/bugfix/update-on-tile-clear
maurhofer-ubique Feb 3, 2025
1df0004
fixes icon layer scale crash
zimmermannubique Feb 4, 2025
f162baa
Fixes icon layer selection in 3D
bastianmorath Feb 6, 2025
600051a
Fix memory leak from gpc_polygon in TileWrapper
matzf Feb 7, 2025
e633a1b
make auto-pause optional
maerki Feb 7, 2025
710357d
only fade dash in one direction
maerki Feb 7, 2025
84b7ac4
fix crash
maerki Feb 7, 2025
f8f9b8c
Merge branch 'develop' into bugfix/icon-layer-3d-selection-fixes
maerki Feb 7, 2025
c7f3181
Uses Vector2FHelper for rotation
bastianmorath Feb 10, 2025
3c12e04
Merge pull request #686 from openmobilemaps/bugfix/icon-layer-3d-sele…
bastianmorath Feb 10, 2025
481ed36
define fieldofview as horizontal
maerki Feb 12, 2025
736d9d5
fix fovy
maerki Feb 12, 2025
9859bf3
call sizechanged on main actor
maerki Feb 12, 2025
fc2ed57
Merge pull request #687 from openmobilemaps/bugfix/memory-leak-tile-p…
matzf Feb 17, 2025
f870bb4
Java bindings: add BaseDataLoader, OffscreenMapRenderer quirks
matzf Jan 28, 2025
7a657c3
Java bindings: premultiply Alpha in BufferedImageTextureHolder
matzf Feb 7, 2025
5308660
github: expand jvm package deploy workflow to fix base image and allo…
matzf Jan 30, 2025
a70ed77
Merge pull request #688 from openmobilemaps/feature/jvm-loaders-offsc…
matzf Feb 24, 2025
041cbc1
adds simple line shader
stmitt Feb 28, 2025
8509865
fixes a bug in halffloat conversion
stmitt Feb 28, 2025
c1c8020
use half precision for line styling
stmitt Feb 28, 2025
496f42a
adds android shader for simple lines
stmitt Feb 28, 2025
8d328c8
MapView GLThread logger
maurhofer-ubique Feb 28, 2025
d414057
Optimize OSMesa Java bindings
matzf Feb 28, 2025
6afa3e8
Merge pull request #695 from openmobilemaps/feature/jvm-optimize-osmesa
matzf Mar 3, 2025
3bfbc5e
Merge pull request #692 from openmobilemaps/feature/MAP-18-line-memor…
stmitt Mar 3, 2025
5cce6ab
Fixes accidentally inverted boolean checks
stmitt Mar 4, 2025
5dfedb5
Merge pull request #697 from openmobilemaps/bugfix/MAP-9-fixes-flicke…
stmitt Mar 4, 2025
756c587
Merge remote-tracking branch 'origin/main' into develop
stmitt Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .github/workflows/jvm_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Maven build JVM
on:
pull_request:
branches: [ main, develop, release/** ]

jobs:
build:
name: Build JVM Project
uses: UbiqueInnovation/workflows-backend/.github/workflows/mvn_install.yml@main
with:
ref_name: ${{ github.sha }}
checkout_submodules: recursive
parent_pom: jvm/pom.xml
install_apt_packages: "cmake make clang libgl-dev libgles-dev libosmesa6-dev"
use_mvn_central: true
65 changes: 65 additions & 0 deletions .github/workflows/jvm_package_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Maven build and deploy JVM
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
package_version:
description: 'Custom version to use for maven package. Defaults to `git describe`.'
required: false

jobs:
build:
name: Build JVM package and deploy to Maven repo
# Based on: UbiqueInnovation/workflows-backend/.github/workflows/mvn_package_deploy.yml@feature/alt-deployment-repository
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-

- name: Install build dependency apt packages
run: |
sudo apt install cmake make clang libgl-dev libgles-dev libosmesa6-dev

- name: Create custom artifactory settings.xml
uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d
with:
servers: '[{"id": "ubique-artifactory", "username": "${{ secrets.UB_ARTIFACTORY_USER}}", "password": "${{ secrets.UB_ARTIFACTORY_PASSWORD }}"}]'
repositories: '[{"id" : "ubique-artifactory", "url" : "${{ secrets.UB_ARTIFACTORY_URL }}${{ secrets.UB_ARTIFACTORY_REPO_BACKEND }}"}]'


- name: Set custom VERSION from workflow dispatch input
if: ${{ inputs.package_version }}
run: echo "VERSION=${{ inputs.package_version }}" >> $GITHUB_ENV

- name: Set VERSION with git describe
if: ${{ ! inputs.package_version }}
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV

- name: Set version
run: |
set -x
# Strip leading `v` from VERSION
# Replace all characters in `\/:"<>|?*` by `-` in VERSION
VERSION=$(echo "$VERSION" | sed 's/[\/:"<>|?*]/-/g;s/^v//;')
mvn -f jvm/pom.xml versions:set -DnewVersion=$VERSION
mvn -f jvm/pom.xml versions:commit

- name: Build and deploy package
run: mvn -f jvm/pom.xml deploy -DskipTests -DaltDeploymentRepository="ubique-artifactory::${{ secrets.UB_ARTIFACTORY_URL }}${{ secrets.UB_ARTIFACTORY_REPO_BACKEND }}"
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ xcuserdata/

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
build-*/
DerivedData/
*.moved-aside
*.pbxuser
Expand All @@ -72,4 +73,8 @@ DerivedData/
!default.perspectivev3

## Gcc Patch
/*.gcno
/*.gcno

## clangd
.cache/
compile_commands.json
83 changes: 83 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
cmake_minimum_required(VERSION 3.24.0)
project(mapscore
LANGUAGES CXX
)

####
# mapscore OpenGL "proper", i.e. the C++ implementation without language bindings
####
file(GLOB_RECURSE mapscore_SRC
"shared/*.cpp"
"android/src/main/cpp/graphics/*.cpp"
)

add_library(mapscore STATIC ${mapscore_SRC})

find_package(OpenGL)

target_include_directories(mapscore PRIVATE
external/protozero/protozero/include/
external/vtzero/vtzero/include/
external/earcut/earcut/include/mapbox/
shared/src
shared/src/external/pugixml
shared/src/external/gpc
shared/src/logger
shared/src/graphics
shared/src/graphics/helpers
shared/src/map
shared/src/map/camera
shared/src/map/controls
shared/src/map/coordinates
shared/src/map/layers
shared/src/map/layers/objects
shared/src/map/layers/tiled
shared/src/map/layers/tiled/raster
shared/src/map/layers/tiled/wmts
shared/src/map/layers/tiled/vector
shared/src/map/layers/tiled/vector/geojson
shared/src/map/layers/tiled/vector/geojson/geojsonvt
shared/src/map/layers/tiled/vector/tiles
shared/src/map/layers/tiled/vector/tiles/raster
shared/src/map/layers/tiled/vector/tiles/polygon
shared/src/map/layers/tiled/vector/tiles/line
shared/src/map/layers/tiled/vector/sourcemanagers
shared/src/map/layers/tiled/vector/sublayers
shared/src/map/layers/tiled/vector/sublayers/raster
shared/src/map/layers/tiled/vector/sublayers/line
shared/src/map/layers/tiled/vector/sublayers/polygon
shared/src/map/layers/tiled/vector/sublayers/symbol
shared/src/map/layers/tiled/vector/sublayers/background
shared/src/map/layers/tiled/vector/symbol
shared/src/map/layers/tiled/vector/description
shared/src/map/layers/tiled/vector/parsing
shared/src/map/layers/polygon
shared/src/map/layers/icon
shared/src/map/layers/line
shared/src/map/layers/text
shared/src/map/scheduling
shared/src/utils
android/src/main/cpp
android/src/main/cpp/graphics
android/src/main/cpp/graphics/objects
android/src/main/cpp/graphics/shader
android/src/main/cpp/utils
)
target_include_directories(mapscore PUBLIC
shared/public
external/djinni/support-lib/
external/djinni/support-lib/cpp
)
set_property(
SOURCE shared/src/logger/Logger.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:LOG_LEVEL=4> # LogTrace
$<$<CONFIG:Release>:LOG_LEVEL=1>) # LogWarning
target_compile_definitions(mapscore PRIVATE OPENMOBILEMAPS_GL=1)
target_compile_features(mapscore PRIVATE cxx_std_20)
target_compile_options(mapscore PRIVATE -Werror -Wno-deprecated -Wno-reorder -fPIC) # fPIC so we can "embed" into shared mapscore_jni
target_link_libraries(mapscore ${OPENGL_LIBRARIES})

add_subdirectory(standalone)
add_subdirectory(jvm)
23 changes: 15 additions & 8 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,21 @@ include_directories(../bridging/android/jni/graphics/shader)
include_directories(../bridging/android/jni/map)
include_directories(../bridging/android/jni/map/controls)
include_directories(../bridging/android/jni/map/layers)
include_directories(../bridging/android/jni/map/layers/effect)
include_directories(../bridging/android/jni/map/layers/icon)
include_directories(../bridging/android/jni/map/layers/line)
include_directories(../bridging/android/jni/map/layers/objects)
include_directories(../bridging/android/jni/map/layers/polygon)
include_directories(../bridging/android/jni/map/layers/skysphere)
include_directories(../bridging/android/jni/map/layers/text)
include_directories(../bridging/android/jni/map/layers/tiled)
include_directories(../bridging/android/jni/map/layers/tiled/raster)
include_directories(../bridging/android/jni/map/layers/tiled/vector)
include_directories(../bridging/android/jni/map/layers/polygon)
include_directories(../bridging/android/jni/map/layers/icon)
include_directories(../bridging/android/jni/map/layers/line)
include_directories(../bridging/android/jni/map/layers/text)
include_directories(../bridging/android/jni/map/loader)
include_directories(../bridging/android/jni/map/scheduling)
include_directories(../bridging/android/jni/map/coordinates)
include_directories(../bridging/android/jni/map/camera)
include_directories(../bridging/android/jni/utils)
include_directories(../shared/public)
include_directories(../shared/src)
include_directories(../shared/src/external/pugixml)
Expand All @@ -81,7 +84,13 @@ include_directories(../shared/src/map/camera)
include_directories(../shared/src/map/controls)
include_directories(../shared/src/map/coordinates)
include_directories(../shared/src/map/layers)
include_directories(../shared/src/map/layers/effect)
include_directories(../shared/src/map/layers/icon)
include_directories(../shared/src/map/layers/objects)
include_directories(../shared/src/map/layers/polygon)
include_directories(../shared/src/map/layers/line)
include_directories(../shared/src/map/layers/skysphere)
include_directories(../shared/src/map/layers/text)
include_directories(../shared/src/map/layers/tiled)
include_directories(../shared/src/map/layers/tiled/raster)
include_directories(../shared/src/map/layers/tiled/wmts)
Expand All @@ -102,18 +111,16 @@ include_directories(../shared/src/map/layers/tiled/vector/sublayers/background)
include_directories(../shared/src/map/layers/tiled/vector/symbol)
include_directories(../shared/src/map/layers/tiled/vector/description)
include_directories(../shared/src/map/layers/tiled/vector/parsing)
include_directories(../shared/src/map/layers/polygon)
include_directories(../shared/src/map/layers/icon)
include_directories(../shared/src/map/layers/line)
include_directories(../shared/src/map/layers/text)
include_directories(../shared/src/map/scheduling)
include_directories(../shared/src/utils)
include_directories(src/main/cpp)
include_directories(src/main/cpp/graphics)
include_directories(src/main/cpp/graphics/objects)
include_directories(src/main/cpp/graphics/shader)
include_directories(src/main/cpp/utils)
include_directories(src/main/cpp/scheduling)

target_compile_definitions(mapscore PRIVATE OPENMOBILEMAPS_GL=1)

# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
Expand Down
2 changes: 1 addition & 1 deletion android/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ implementation 'com.squareup.okhttp3:okhttp:4.12.0' // used for the default Data

### Initializing the library

To use the library, it needs to be initialized as early as possible, e.g. in the oOnCreate(), of the hosting Application by calling:
To use the library, it needs to be initialized as early as possible, e.g. in the OnCreate(), of the hosting Application by calling:

```kotlin
MapsCore.initialize()
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/cpp/graphics/OpenGlContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <string>
#include <unordered_map>

class OpenGlContext : public RenderingContextInterface, std::enable_shared_from_this<OpenGlContext> {
class OpenGlContext : public RenderingContextInterface, public std::enable_shared_from_this<OpenGlContext> {
public:
OpenGlContext();

Expand Down
23 changes: 22 additions & 1 deletion android/src/main/cpp/graphics/OpenGlHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,28 @@ class OpenGlHelper {
static void checkGlError(const std::string &glOperation) {
int error;
while ((error = glGetError()) != GL_NO_ERROR) {
LogError << "GL ERROR: " << glOperation << " " <<= error;
LogError << "GL ERROR: " << glOperation << " " <<= errorString(error);
}
}

static std::string errorString(GLenum errorCode) {
switch (errorCode) {
case GL_INVALID_ENUM:
return "INVALID_ENUM";
case GL_INVALID_VALUE:
return "INVALID_VALUE";
case GL_INVALID_OPERATION:
return "INVALID_OPERATION";
case GL_STACK_OVERFLOW:
return "STACK_OVERFLOW";
case GL_STACK_UNDERFLOW:
return "STACK_UNDERFLOW";
case GL_OUT_OF_MEMORY:
return "OUT_OF_MEMORY";
case GL_INVALID_FRAMEBUFFER_OPERATION:
return "INVALID_FRAMEBUFFER_OPERATION";
default:
return "UNKNOWN_ERROR(" + std::to_string(errorCode) + ")";
}
}
};
1 change: 1 addition & 0 deletions android/src/main/cpp/graphics/objects/Polygon2dOpenGl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void Polygon2dOpenGl::render(const std::shared_ptr<::RenderingContextInterface>
}

void Polygon2dOpenGl::drawPolygon(const std::shared_ptr<::RenderingContextInterface> &context, int program, int64_t vpMatrix, int64_t mMatrix, const Vec3D &origin) {
std::lock_guard<std::recursive_mutex> lock(dataMutex);
// Add program to OpenGL environment
glUseProgram(program);

Expand Down
28 changes: 22 additions & 6 deletions android/src/main/cpp/graphics/objects/Quad2dOpenGl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "Quad2dOpenGl.h"
#include "TextureHolderInterface.h"
#include "TextureFilterType.h"
#include <cmath>

Quad2dOpenGl::Quad2dOpenGl(const std::shared_ptr<::ShaderProgramInterface> &shader)
Expand Down Expand Up @@ -37,13 +38,13 @@ void Quad2dOpenGl::clear() {

void Quad2dOpenGl::setIsInverseMasked(bool inversed) { isMaskInversed = inversed; }

void Quad2dOpenGl::setFrame(const Quad3dD &frame, const RectD &textureCoordinates, const Vec3D &origin, bool is3D) {
void Quad2dOpenGl::setFrame(const Quad3dD &frame, const RectD &textureCoordinates, const Vec3D &origin, bool is3d) {
std::lock_guard<std::recursive_mutex> lock(dataMutex);
ready = false;
this->frame = frame;
this->textureCoordinates = textureCoordinates;
this->quadOrigin = origin;
this->is3D = is3D;
this->is3d = is3d;
}

void Quad2dOpenGl::setSubdivisionFactor(int32_t factor) {
Expand All @@ -53,6 +54,11 @@ void Quad2dOpenGl::setSubdivisionFactor(int32_t factor) {
}
}

void Quad2dOpenGl::setMinMagFilter(TextureFilterType filterType) {
std::lock_guard<std::recursive_mutex> lock(dataMutex);
textureFilterType = filterType;
}

void Quad2dOpenGl::setup(const std::shared_ptr<::RenderingContextInterface> &context) {
std::lock_guard<std::recursive_mutex> lock(dataMutex);
if (ready) {
Expand All @@ -79,7 +85,7 @@ void Quad2dOpenGl::computeGeometry(bool texCoordsOnly) {
// Data mutex covered by caller Quad2dOpenGL::setup()
if (subdivisionFactor == 0) {
if (!texCoordsOnly) {
if (is3D) {
if (is3d) {
vertices = {
(float) (1.0 * std::sin(frame.topLeft.y) * std::cos(frame.topLeft.x) - quadOrigin.x),
(float) (1.0 * cos(frame.topLeft.y) - quadOrigin.y),
Expand Down Expand Up @@ -152,8 +158,8 @@ void Quad2dOpenGl::computeGeometry(bool texCoordsOnly) {
if (!texCoordsOnly) {
double x = originX + deltaDX;
double y = originY + deltaDY;
double z = is3D ? originZ + deltaDZ : 0.0;
if (is3D) {
double z = is3d ? originZ + deltaDZ : 0.0;
if (is3d) {
vertices.push_back((float) (1.0 * std::sin(y) * std::cos(x) - quadOrigin.x));
vertices.push_back((float) (1.0 * cos(y) - quadOrigin.y));
vertices.push_back((float) (-1.0 * std::sin(x) * std::sin(y) - quadOrigin.z));
Expand Down Expand Up @@ -206,6 +212,8 @@ void Quad2dOpenGl::prepareGlData(int program) {
vpMatrixHandle = glGetUniformLocation(program, "uvpMatrix");
mMatrixHandle = glGetUniformLocation(program, "umMatrix");
originOffsetHandle = glGetUniformLocation(program, "uOriginOffset");
originHandle = glGetUniformLocation(program, "uOrigin");

glDataBuffersGenerated = true;
}

Expand Down Expand Up @@ -289,7 +297,7 @@ void Quad2dOpenGl::renderAsMask(const std::shared_ptr<::RenderingContextInterfac
render(context, renderPass, vpMatrix, mMatrix, origin, false, screenPixelAsRealMeterFactor);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}

#include "Logger.h"
void Quad2dOpenGl::render(const std::shared_ptr<::RenderingContextInterface> &context, const RenderPassConfig &renderPass,
int64_t vpMatrix, int64_t mMatrix, const ::Vec3D &origin, bool isMasked,
double screenPixelAsRealMeterFactor) {
Expand Down Expand Up @@ -337,6 +345,9 @@ void Quad2dOpenGl::render(const std::shared_ptr<::RenderingContextInterface> &co
glUniformMatrix4fv(vpMatrixHandle, 1, false, (GLfloat *)vpMatrix);
glUniformMatrix4fv(mMatrixHandle, 1, false, (GLfloat *)mMatrix);
glUniform4f(originOffsetHandle, quadOrigin.x - origin.x, quadOrigin.y - origin.y, quadOrigin.z - origin.z, 0.0);
if (originHandle >= 0) {
glUniform4f(originHandle, origin.x, origin.y, origin.z, 1.0);
}

// Draw the triangles
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
Expand Down Expand Up @@ -364,6 +375,11 @@ void Quad2dOpenGl::prepareTextureDraw(int program) {

// Bind the texture to this unit.
glBindTexture(GL_TEXTURE_2D, (unsigned int)texturePointer);
if (textureFilterType.has_value()) {
GLint filterParam = GL_NEAREST;//*textureFilterType == TextureFilterType::LINEAR ? GL_LINEAR : GL_NEAREST;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterParam);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterParam);
}

// Tell the texture uniform sampler to use this texture in the shader by binding to texture unit 0.
int textureUniformHandle = glGetUniformLocation(program, "textureSampler");
Expand Down
Loading