Skip to content

Commit

Permalink
Merge branch develop to main for 3.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSylvester committed Feb 1, 2022
2 parents 453f36a + 564beb4 commit 4364780
Show file tree
Hide file tree
Showing 1,176 changed files with 9,194 additions and 5,679 deletions.
2 changes: 1 addition & 1 deletion WhirlyGlobe.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Pod::Spec.new do |s|
s.author = { "Steve Gifford" => "[email protected]" }
s.social_media_url = 'https://twitter.com/@mousebirdc'

s.platform = :ios, '9.0'
s.platform = :ios, '12.0'
s.requires_arc = true

s.source = { :git => 'https://github.com/mousebird/WhirlyGlobe.git', :branch => 'develop' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford on 3/22/19.
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Tim Sylvester on 9 Feb 2021.
* Copyright 2021 mousebird consulting
* Copyright 2021-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by sjg
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -102,12 +102,12 @@ class CartoTestCase(activity: Activity) :

// Generate the fetch request for the chunk of data we want
override fun fetchInfoForTile(tileID: TileID?, flipY: Boolean): Any {
val bbox = theLoader?.geoBoundsForTile(tileID)
val bbox = tileID?.let { theLoader?.geoBoundsForTile(it) } ?: Mbr()

// Construct the query string
val fetchInfo = RemoteTileFetchInfo()
val toDeg = 180.0/ PI
val query = String.format(search,bbox!!.ll.x*toDeg,bbox.ll.y*toDeg,bbox.ur.x*toDeg,bbox.ur.y*toDeg)
val query = String.format(search,bbox.ll.x*toDeg,bbox.ll.y*toDeg,bbox.ur.x*toDeg,bbox.ur.y*toDeg)
val encodeQuery = URLEncoder.encode(query,"utf-8")
val fullURLStr = String.format("https://pluto.cartodb.com/api/v2/sql?format=GeoJSON&q=%s",encodeQuery)
fetchInfo.urlReq = Request.Builder().url(URL(fullURLStr)).build()
Expand Down Expand Up @@ -135,5 +135,11 @@ class CartoTestCase(activity: Activity) :
loadReturn.addComponentObject(vc.addVector(vecObj,vecInfoFill,ThreadMode.ThreadCurrent))
loadReturn.addComponentObject(vc.addVector(vecObj,vecInfoOutline,ThreadMode.ThreadCurrent))
}

/**
* Some tiles were just removed.
*/
override fun tilesUnloaded(ids: Array<out TileID>) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford on 2/13/16.
* Copyright 2016-2021 mousebird consulting
* Copyright 2016-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford on 2/13/16.
* Copyright 2016-2021 mousebird consulting
* Copyright 2016-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by sjg
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by jmnavarro
* Copyright 2011-2015 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by Tim Sylvester on 9 Feb 2021.
* Copyright 2021 mousebird consulting
* Copyright 2021-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@ package com.mousebirdconsulting.autotester.TestCases

import android.app.Activity
import android.graphics.BitmapFactory
import android.graphics.Color
import android.os.Handler
import com.mousebird.maply.*
import com.mousebirdconsulting.autotester.Framework.MaplyTestCase
Expand Down Expand Up @@ -56,8 +57,8 @@ class MovingScreenMarkersTestCase(activity: Activity) :
controller.addTexture(icon1, null, threadCurrent)!!)

timerRunnable = Runnable {
clearMarkers()
markerObj = makeMarkers()
clear()
objs.addAll(makeMarkers())
timerRunnable?.let {
timerHandler.postDelayed(it, (1000 * duration).toLong())
}
Expand All @@ -72,25 +73,24 @@ class MovingScreenMarkersTestCase(activity: Activity) :
timerHandler.removeCallbacks(it)
}

clear()

baseCase.shutdown()
super.shutdown()
}

private fun clearMarkers() {
markerObj?.also {
controller.removeObject(it, threadCurrent)
markerObj = null
}
private fun clear() {
controller.removeObjects(objs, threadCurrent)
objs.clear()
}

private fun makeMarkers(): ComponentObject? {
private fun makeMarkers(): Collection<ComponentObject> {
val pts = arrayOf(
Point2d.FromDegrees(0.0, 0.0),
Point2d.FromDegrees(10.0, 10.0),
Point2d.FromDegrees(0.0, 20.0),
Point2d.FromDegrees(-10.0, 10.0)
)

val markers = pts.indices.map {
ScreenMovingMarker().apply {
duration = this@MovingScreenMarkersTestCase.duration
Expand All @@ -102,9 +102,27 @@ class MovingScreenMarkersTestCase(activity: Activity) :
layoutImportance = Float.MAX_VALUE
}
}
return controller.addScreenMovingMarkers(markers, MarkerInfo(), threadCurrent)
val labels = pts.indices.map {
ScreenMovingLabel().apply {
duration = this@MovingScreenMarkersTestCase.duration
//period = [email protected] / 2
loc = pts[it]
endLoc = pts[(it + 1) % pts.size]
layoutImportance = Float.MAX_VALUE
offset = Point2d(20.0, -10.0)
text = "<=="
}
}
val labelInfo = LabelInfo().apply {
textColor = Color.RED
fontSize = 20.0f
}
return listOfNotNull(
controller.addScreenMovingMarkers(markers, MarkerInfo(), threadCurrent),
controller.addScreenMovingLabels(labels, labelInfo, threadCurrent)
)
}

private val threadCurrent = ThreadMode.ThreadCurrent

private var baseCase = VectorsTestCase(activity)
Expand All @@ -114,5 +132,5 @@ class MovingScreenMarkersTestCase(activity: Activity) :
private val timerHandler = Handler()

private var textures: Array<MaplyTexture>? = null
private var markerObj: ComponentObject? = null
private val objs = ArrayList<ComponentObject>()
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by sjg
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by rghosh on 2017-03-14.
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by sjg
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class SimpleStyleTestCase(activity: Activity) : MaplyTestCase(activity, "Simple
super.userDidSelect(mapControl, selObjs, loc, screenLoc)
selObjs?.forEach { so ->
(so.selObj as? VectorObject)?.let { obj ->
val json = obj.attributes.getString("json")
val x = json
val json = obj.attributes?.getString("json")
}
}
}
Expand Down Expand Up @@ -88,12 +87,10 @@ class SimpleStyleTestCase(activity: Activity) : MaplyTestCase(activity, "Simple
obj.selectable = true
if (obj.attributes == null) {
// has no effect if the vector object has no shapes
obj.attributes = AttrDictionary()
obj.setAttributes(AttrDictionary())
}
if (obj.attributes != null) {
obj.attributes.setString("json", json);
}

obj.attributes?.setString("json", json);

if (obj.fromGeoJSON(json)) {
styleMan.addFeatures(obj, threadAny)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford on 3/22/19.
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2019 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -78,8 +78,8 @@ class TextureVectorTestCase(activity: Activity) : MaplyTestCase(activity, "Textu
// Center of the texture application
val center = loopObj.center()
val attrs = loopObj.attributes
attrs.setDouble("veccenterx", center.x)
attrs.setDouble("veccentery", center.y)
attrs?.setDouble("veccenterx", center.x)
attrs?.setDouble("veccentery", center.y)

var thisClipGridLon = ClipGridSize
if (isGlobe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WhirlyGlobeLib
*
* Created by Steve Gifford.
* Copyright 2011-2021 mousebird consulting
* Copyright 2011-2022 mousebird consulting
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 4364780

Please sign in to comment.