Skip to content

Commit

Permalink
Merge develop to main for 3.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSylvester committed Apr 8, 2022
2 parents 4364780 + bab1fdf commit 09f3e74
Show file tree
Hide file tree
Showing 404 changed files with 10,219 additions and 3,480 deletions.
22 changes: 0 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ WhirlyGlobeSrc/AutoTester/AutoTester.xcworkspace
*.class
**/*.iml
**/.idea
android/**/local.properties
android/library/Android/.gradle
android/library/maply/.cxx
ios/library/WhirlyGlobe-MaplyComponent/build
ios/library/WhirlyGlobe-MaplyComponent/WhirlyGlobeMaplyComponent.framework

podlint\.txt

android/library/maply/\.externalNativeBuild/

android/apps/AutoTesterAndroid/app/release/
android/library/maply/.cxx/

~\$TestCaseStatus\.xlsx

~\$CodeBreakdown\.xlsx

android/apps/AutoTesterAndroid/app/gradle/wrapper/

android/apps/AutoTesterAndroid/app/gradlew

android/apps/AutoTesterAndroid/app/gradlew.bat
android/library/Android/build/
android/library/Android/libs/
android/library/Android/obj/
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![WhirlyGlobe-Maply](/common/images/banner.jpg)

[![Apache v2](https://img.shields.io/badge/License-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Release 3.4](https://img.shields.io/badge/Release-3.4-blue.svg)](https://github.com/mousebird-consulting-inc/WhirlyGlobe/releases)
[![Release 3.5](https://img.shields.io/badge/Release-3.5-blue.svg)](https://github.com/mousebird-consulting-inc/WhirlyGlobe/releases)
![Platform iOS+Android](https://img.shields.io/badge/Platform-%20iOS%20%7c%20Android-blue.svg)
[![Open Issues](https://img.shields.io/github/issues/mousebird-consulting-inc/WhirlyGlobe.svg?color=blue)](https://github.com/mousebird-consulting-inc/WhirlyGlobe/issues)
[![Closed Issues](https://img.shields.io/github/issues-closed/mousebird-consulting-inc/WhirlyGlobe.svg?color=blue)](https://github.com/mousebird-consulting-inc/WhirlyGlobe/issues?q=is%3Aissue+is%3Aclosed)
Expand Down Expand Up @@ -33,7 +33,7 @@ Builds
-: | :-
[![Android Build Status](https://app.bitrise.io/app/36f069a6fbd58b11.svg?token=XD5YnMiUwnj0169yhIOkPQ)](https://app.bitrise.io/app/36f069a6fbd58b11) | Android Main

This is the main branch of the WhirlyGlobe-Maply Component and API version 3.4. It should be easy to compile, as all the crazy dependencies are in submodules. You can also get a [precompiled version](https://mousebird-consulting-inc.github.io/WhirlyGlobe/builds/builds.html).
This is the main branch of the WhirlyGlobe-Maply Component and API version 3.5. It should be easy to compile, as all the crazy dependencies are in submodules. You can also get a [precompiled version](https://mousebird-consulting-inc.github.io/WhirlyGlobe/builds/builds.html).

WhirlyGlobe-Maply uses a bunch of submodules, which you'll need to get. Like so:

Expand All @@ -48,6 +48,14 @@ Once you get all this synced, try to build AutoTester. If it builds, you're good

Want more detail? Go read the [Tutorials](http://mousebird-consulting-inc.github.io/WhirlyGlobe/tutorial/) on the WhirlyGlobe-Maply site.

Breaking Changes
---

If you're upgrading from 3.3, you will need to make some adjustments due to the switch to xcframework and modular headers:

- When embedding the framework as is done in AutoTester, Swift no longer automatically imports the module because it doesn't match the project name. You will need an additional `import WhirlyGlobe` at the top of Swift files using the API.
- If you're including header files from Obj-C++ code, you'll need to use the modular include style, `#import <WhirlyGlobe/Header.h>`, and using quoted includes will produce a compile error.

More Information
---

Expand Down
63 changes: 43 additions & 20 deletions WhirlyGlobe.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "WhirlyGlobe"
s.version = "3.4"
s.version = "3.5"
s.summary = "WhirlyGlobe-Maply: Geospatial visualization for iOS and Android."
s.description = <<-DESC
WhirlyGlobe-Maply is a high performance geospatial display toolkit for iOS and Android.
Expand All @@ -20,17 +20,41 @@ Pod::Spec.new do |s|
s.license = 'Apache 2.0'
s.author = { "Steve Gifford" => "[email protected]" }
s.social_media_url = 'https://twitter.com/@mousebirdc'

s.platform = :ios, '12.0'
s.requires_arc = true
s.source = { :git => 'https://github.com/mousebird/WhirlyGlobe.git', :branch => 'topic/xcframework' }
s.module_name = "WhirlyGlobe"
s.default_subspec = "WhirlyGlobe"
s.compiler_flags = ""

s.source = { :git => 'https://github.com/mousebird/WhirlyGlobe.git', :branch => 'develop' }

s.compiler_flags = '-D__USE_SDL_GLES__ -D__IPHONEOS__ -DSQLITE_OPEN_READONLY -DHAVE_PTHREAD=1 -DUNORDERED=1 '
s.xcconfig = { "HEADER_SEARCH_PATHS" => " \"$(SDKROOT)/usr/include/libxml2\" \"$(PODS_ROOT)/KissXML/KissXML/\" \"$(PODS_ROOT)/WhirlyGlobe/common/local_libs/eigen/\" \"${PODS_ROOT}/WhirlyGlobe/common/local_libs/nanopb/\" \"${PODS_ROOT}/WhirlyGlobe/common/local_libs/clipper\" \"${PODS_ROOT}/WhirlyGlobe/common/local_libs/lodepng\" \"${PODS_ROOT}/WhirlyGlobe/common/local_libs/glues/include/\" \"$(PODS_ROOT)/WhirlyGlobe/common/local_libs/GeographicLib/include/\" \"$(PODS_ROOT)/WhirlyGlobe/ios/library/WhirlyGlobe-MaplyComponent/include/private/\" \"$(PODS_ROOT)/WhirlyGlobe/ios/library/WhirlyGlobe-MaplyComponent/include/\" \"$(PODS_ROOT)/WhirlyGlobe/ios/library/WhirlyGlobe-MaplyComponent/include/vector_tiles/\" ",
"MTL_LANGUAGE_REVISION" => "Metal21" }

s.default_subspec = 'MaplyComponent'
s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES",
"MTL_LANGUAGE_REVISION" => "Metal21",
"GCC_PREPROCESSOR_DEFINITIONS" => %w(
__USE_SDL_GLES__
__IPHONEOS__
SQLITE_OPEN_READONLY
HAVE_PTHREAD=1
).join(" "),
"HEADER_SEARCH_PATHS" => %w(
"$(SDKROOT)/usr/include/libxml2"
"$(PODS_ROOT)/KissXML/KissXML/"
"${PODS_TARGET_SRCROOT}/common/local_libs/eigen/"
"${PODS_TARGET_SRCROOT}/common/local_libs/nanopb/"
"${PODS_TARGET_SRCROOT}/common/local_libs/clipper"
"${PODS_TARGET_SRCROOT}/common/local_libs/lodepng"
"${PODS_TARGET_SRCROOT}/common/local_libs/glues/include/"
"${PODS_TARGET_SRCROOT}/common/local_libs/GeographicLib/include/"
"${PODS_TARGET_SRCROOT}/ios/library/WhirlyGlobe-MaplyComponent/include/private/"
"${PODS_TARGET_SRCROOT}/ios/library/WhirlyGlobe-MaplyComponent/include/"
"${PODS_TARGET_SRCROOT}/ios/library/WhirlyGlobe-MaplyComponent/include/vector_tiles/"
).join(" "),
# For angle-bracket includes
"SYSTEM_HEADER_SEARCH_PATHS" => %w(
).join(" "),
"CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO",
"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES"
}

s.subspec 'locallibs' do |ll|
ll.source_files =
Expand Down Expand Up @@ -59,27 +83,26 @@ Pod::Spec.new do |s|
gl.private_header_files = 'common/local_libs/glues/**/*.h'
end

s.subspec 'MaplyComponent' do |mc|
s.subspec 'WhirlyGlobe' do |mc|
mc.source_files =
'common/WhirlyGlobeLib/src/*.{c,cpp}',
'common/WhirlyGlobeLib/include/*.h',
'common/WhirlyGlobeLib/include/vector_tile.pb.h',
'ios/library/WhirlyGlobeLib/src/*.{mm,m,cpp,metal}',
'ios/library/WhirlyGlobeLib/include/*.h',
'ios/library/WhirlyGlobe-MaplyComponent/include/**/*.h',
'ios/library/WhirlyGlobe-MaplyComponent/src/**/*.{mm,m,cpp,metal}',
'ios/library/WhirlyGlobe-MaplyComponent/include/MaplyBridge.h'
mc.preserve_paths =
'common/local_libs/eigen/Eigen/**'
'ios/library/WhirlyGlobe-MaplyComponent/WhirlyGlobeMaplyComponent/*.h'
mc.exclude_files =
'common/WhirlyGlobeLib/src/*GLES.{h,cpp}',
'ios/library/WhirlyGlobeLib/src/Texture_iOS.mm',
'ios/library/WhirlyGlobeLib/include/TextureGLES_iOS.h'
mc.public_header_files =
'common/WhirlyGlobeLib/include/*.h',
'ios/library/WhirlyGlobe-MaplyComponent/include/*.h',
"ios/library/WhirlyGlobe-MaplyComponent/include/vector_tiles/*.h",
'ios/library/WhirlyGlobeLib/include/GeographicLib.h' # That we have to name it here means it probably belongs somewhere else...
'ios/library/WhirlyGlobe-MaplyComponent/include/**/*.h',
'ios/library/WhirlyGlobe-MaplyComponent/WhirlyGlobeMaplyComponent/*.h'
mc.private_header_files =
'common/WhirlyGlobeLib/include/vector_tile.pb.h',
'common/WhirlyGlobeLib/include/**/*.h',
'ios/library/WhirlyGlobeLib/include/*.h',
'ios/library/WhirlyGlobe-MaplyComponent/include/MaplyBridge.h'
'ios/library/WhirlyGlobe-MaplyComponent/include/private/*.h'
mc.dependency 'WhirlyGlobe/locallibs'
mc.dependency 'WhirlyGlobe/glues'
mc.dependency 'SMCalloutView'
Expand Down
12 changes: 12 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/local.properties
library/Android/.gradle
library/maply/.cxx
library/maply/\.externalNativeBuild/
apps/AutoTesterAndroid/app/release/
library/maply/.cxx/
apps/AutoTesterAndroid/app/gradle/wrapper/
apps/AutoTesterAndroid/app/gradlew
apps/AutoTesterAndroid/app/gradlew.bat
library/Android/build/
library/Android/libs/
library/Android/obj/
6 changes: 3 additions & 3 deletions android/apps/AutoTesterAndroid/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
storePassword System.getenv('BITRISEIO_ANDROID_KEYSTORE_PASSWORD')
}
}
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "com.mousebirdconsulting.autotester"
minSdkVersion 21
targetSdkVersion 29
minSdkVersion 26
targetSdkVersion 30
versionCode 1
versionName "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class BillboardAdapter(private val viewC: GlobeController,

// Sun
val billSun = Billboard().apply {
val sunPosition = sun.asPosition()
center = Point3d(sunPosition[0].toDouble(), sunPosition[1].toDouble(), 5.4 * EarthRadius)
val sunPosition = sun.position
center = Point3d(sunPosition.x, sunPosition.y, 5.4 * EarthRadius)
selectable = false

screenObject = ScreenObject().apply {
Expand All @@ -77,7 +77,7 @@ class BillboardAdapter(private val viewC: GlobeController,
cal.timeZone = SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC")

val moon = Moon(cal)
val moonPosition = moon.asPosition()
val moonPosition = moon.position

center = Point3d(moonPosition.x, moonPosition.y, 5.4 * EarthRadius)
screenObject = ScreenObject().apply {
Expand All @@ -95,6 +95,8 @@ class BillboardAdapter(private val viewC: GlobeController,
waveLength = floatArrayOf(0.650f, 0.570f, 0.475f)
setSunPosition(sun.direction)
}

viewC.setPositionGeo(sun.position.x + 2 * Math.PI, 0.0, 2.0)
}

var atmosphere: Atmosphere? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.content.ContextWrapper;
import android.util.Log;

import androidx.annotation.Nullable;

import com.mousebird.maply.GlobeController;
import com.mousebird.maply.MBTileFetcher;
import com.mousebird.maply.MapController;
Expand Down Expand Up @@ -160,8 +162,12 @@ private void setupImageLoader(BaseController baseController, String mbTilesName,
}
}

private MBTileFetcher mbTileFetcher;
private QuadImageLoader loader;
public @Nullable QuadImageLoader getLoader() {
return loader;
}

private @Nullable MBTileFetcher mbTileFetcher;
private @Nullable QuadImageLoader loader;

@Override
public boolean setUpWithGlobe(GlobeController globeVC) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import okio.buffer
import android.app.Activity
import com.mousebirdconsulting.autotester.Framework.MaplyTestCase
import android.graphics.Color
import android.os.Handler
import android.os.Looper
import android.util.Log
import com.mousebird.maply.*
import com.mousebird.maply.RenderControllerInterface.TextureSettings
Expand Down Expand Up @@ -42,7 +44,7 @@ class WideVectorsTestCase(activity: Activity?) :
it.drawPriority = drawPriority
if (tex != null) {
it.setTexture(tex)
it.setTextureRepeatLength(8.0)
it.textureRepeatLength = 8.0
}
it.edgeFalloff = edge
}
Expand Down Expand Up @@ -77,6 +79,13 @@ class WideVectorsTestCase(activity: Activity?) :
componentObjects.addAll(addGeoJSON(baseController, "testJson.geojson", 20.0f, pri, Color.BLUE, true, 1.0))
componentObjects.addAll(addGeoJSON(baseController, "sawtooth.geojson", 50.0f, pri, Color.RED, false, 20.0))
componentObjects.addAll(offsetTests(baseController))

// Expressions require the loader to be set up so we can get a zoom slot... at least until
// we have a non-loader-dependent zoom slot (See #1523). Lacking a way to run code after
// the loader setup completes, a la `addPostSurfaceRunnable`, just wait a while.
Handler(Looper.getMainLooper()).postDelayed({
componentObjects.addAll(expressionTests(baseController))
}, 1000)
}

private fun offsetTests(vc: BaseController): Collection<ComponentObject> {
Expand Down Expand Up @@ -117,9 +126,9 @@ class WideVectorsTestCase(activity: Activity?) :
val vecAttrs = AttrDictionary()
val clAttrs = AttrDictionary()
if (k > 0) {
val cc = 50 * i;
vecAttrs.setInt("color", Color.argb(129, 0,cc,255 - cc));
clAttrs.setInt("color", Color.argb(192,0,255 - cc,cc));
val cc = 50 * i
vecAttrs.setInt("color", Color.argb(129, 0,cc,255 - cc))
clAttrs.setInt("color", Color.argb(192,0,255 - cc,cc))
}
val vecObj = VectorObject.createLineString(coords, vecAttrs)?.subdivideToGlobe(0.0001)
val clObj = VectorObject.createLineString(coords, clAttrs)?.subdivideToGlobe(0.0001)
Expand All @@ -133,17 +142,61 @@ class WideVectorsTestCase(activity: Activity?) :
}
}

private fun expressionTests(vc: BaseController): Collection<ComponentObject> {
val coords = arrayOf(
Point2d.FromDegrees(-100.0, 60.0),
Point2d.FromDegrees(-110.0, 61.0),
Point2d.FromDegrees(-120.0, 62.0),
)

val wideInfo = WideVectorInfo().also {
it.setColor(1.0f, 0.0f, 0.0f, 1.0f)
it.enable = true
it.setFade(0.0)
it.drawPriority = VectorInfo.VectorPriorityDefault
it.edgeFalloff = 1.0
it.offset = 2.0
it.lineWidth = 20.0f

it.zoomSlot = baseTestCase.loader?.zoomSlot ?: -1

val c1 = Color.argb(1.0f, 0.0f, 1.0f, 0.8f)
val c2 = Color.argb(0.0f, 0.0f, 1.0f, 0.8f)
it.colorExp = ColorExpressionInfo.createLinear(2.0f, c1, 6.0f, c2)
it.opacityExp = FloatExpressionInfo.createLinear(2.0f, 0.2f, 6.0f, 0.9f)
it.widthExp = FloatExpressionInfo.createLinear(2.0f, 1.0f, 6.0f, 20.0f)
it.offsetExp = FloatExpressionInfo.createLinear(2.0f, -20.0f, 6.0f, 20.0f)
}
val info = VectorInfo().also {
it.setColor(1.0f, 0.0f, 1.0f, 0.8f)
it.enable = true
it.drawPriority = wideInfo.drawPriority + 10
}

val vecObj = VectorObject.createLineString(coords, null)?.subdivideToGlobe(0.0001)
val clObj = VectorObject.createLineString(coords, null)?.subdivideToGlobe(0.0001)

return listOfNotNull(
vc.addVector(clObj, info, ThreadMode.ThreadCurrent),
vc.addWideVector(vecObj, wideInfo, ThreadMode.ThreadCurrent)
)
}

override fun setUpWithMap(mapVC: MapController): Boolean {
baseTestCase.setUpWithMap(mapVC)
wideVecTest(mapVC)
mapVC.animatePositionGeo(Point2d.FromDegrees(-100.0, 40.0), 0.5, 0.0, 1.0)
mapVC.addPostSurfaceRunnable {
wideVecTest(mapVC)
mapVC.animatePositionGeo(Point2d.FromDegrees(-100.0, 40.0), 0.5, 0.0, 1.0)
}
return true
}

override fun setUpWithGlobe(globeVC: GlobeController): Boolean {
baseTestCase.setUpWithGlobe(globeVC)
wideVecTest(globeVC)
globeVC.animatePositionGeo(Point2d.FromDegrees(-100.0, 40.0), 0.5, 0.0, 1.0)
globeVC.addPostSurfaceRunnable {
wideVecTest(globeVC)
globeVC.animatePositionGeo(Point2d.FromDegrees(-100.0, 40.0), 0.5, 0.0, 1.0)
}
return true
}

Expand All @@ -154,6 +207,6 @@ class WideVectorsTestCase(activity: Activity?) :
super.shutdown()
}

private val baseTestCase = CartoLightTestCase(getActivity())
private val baseTestCase = GeographyClass(getActivity())
private val componentObjects: MutableList<ComponentObject> = ArrayList()
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#import "Maply_jni.h"
#import "WhirlyGlobe.h"
#import "WhirlyGlobeLib.h"

namespace WhirlyKit
{
Expand All @@ -36,7 +36,6 @@ class FontTextureManager_Android : public FontTextureManager
// Wrapper for FontManager.
struct FontManager_Android : public FontManager
{
FontManager_Android() = default;
FontManager_Android(PlatformThreadInfo *inst,jobject typefaceObj);
virtual ~FontManager_Android();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import <jni.h>
#endif
#import "Maply_jni.h"
#import "WhirlyGlobe.h"
#import "WhirlyGlobeLib.h"

namespace WhirlyKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#import <jni.h>
#endif
#import "Maply_jni.h"
#import "WhirlyGlobe.h"
#import "WhirlyGlobeLib.h"

namespace WhirlyKit
{
Expand Down
Loading

0 comments on commit 09f3e74

Please sign in to comment.