Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit 27c9100

Browse files
authored
Merge pull request #21 from pixelfat/master
Added utf grid support for .mbtiles map layers.
2 parents 99ab136 + 76acb87 commit 27c9100

24 files changed

+1645
-55
lines changed

Assembly-CSharp.csproj

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>10.0.20506</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{770F3EAF-A465-1243-B39F-65232DC381CA}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace></RootNamespace>
12-
<AssemblyName>Assembly-CSharp</AssemblyName>
13-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<BaseDirectory>Assets</BaseDirectory>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.20506</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<RootNamespace></RootNamespace>
9+
<ProjectGuid>{3F277028-8655-7DA6-E8E6-C3789C8219FE}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<AssemblyName>Assembly-CSharp</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<BaseDirectory>Assets</BaseDirectory>
1616
</PropertyGroup>
1717
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>Temp\bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE;UNITY_4_6_8;UNITY_4_6;UNITY_ANDROID;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_IL2CPP;INCLUDE_WP8SUPPORT;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;UNITY5_SCRIPTING_IN_UNITY4;ENABLE_CACHING;ENABLE_CLOTH;UNITY_ANDROID_API;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_PRO_LICENSE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
<NoWarn>0169</NoWarn>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>Temp\bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_4;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;PLATFORM_SUPPORTS_ADS_ID;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_32;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<NoWarn>0169</NoWarn>
2626
</PropertyGroup>
2727
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>Temp\bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<NoWarn>0169</NoWarn>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>Temp\bin\Release\</OutputPath>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
<NoWarn>0169</NoWarn>
3534
</PropertyGroup>
3635
<ItemGroup>
37-
<Reference Include="System" />
36+
<Reference Include="System" />
3837
<Reference Include="System.XML" />
39-
<Reference Include="System.Core" />
40-
<Reference Include="System.Xml.Linq" />
41-
<Reference Include="UnityEngine">
42-
<HintPath>/Applications/Unity 4/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
43-
</Reference>
44-
<Reference Include="UnityEditor">
45-
<HintPath>/Applications/Unity 4/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
46-
</Reference>
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="UnityEngine">
41+
<HintPath>C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll</HintPath>
42+
</Reference>
43+
<Reference Include="UnityEditor">
44+
<HintPath>C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
45+
</Reference>
4746
</ItemGroup>
4847
<ItemGroup>
4948
<Compile Include="Assets\TestScripts\TestMap.cs" />
@@ -59,6 +58,7 @@
5958
<Compile Include="Assets\UnitySlippyMap\Helpers\SQLite\SqliteDatabase.cs" />
6059
<Compile Include="Assets\UnitySlippyMap\Helpers\SRIDReader.cs" />
6160
<Compile Include="Assets\UnitySlippyMap\Helpers\SharedMaterialManager.cs" />
61+
<Compile Include="Assets\UnitySlippyMap\Helpers\SimpleJSON.cs" />
6262
<Compile Include="Assets\UnitySlippyMap\Helpers\TextureBogusExtension.cs" />
6363
<Compile Include="Assets\UnitySlippyMap\Helpers\UnityThreading\Dispatcher.cs" />
6464
<Compile Include="Assets\UnitySlippyMap\Helpers\UnityThreading\Task.cs" />
@@ -68,6 +68,7 @@
6868
<Compile Include="Assets\UnitySlippyMap\Helpers\VirtualEarth\Metadata.cs" />
6969
<Compile Include="Assets\UnitySlippyMap\Helpers\VirtualEarth\TileSystem.cs" />
7070
<Compile Include="Assets\UnitySlippyMap\Helpers\WMS\WMS111.cs" />
71+
<Compile Include="Assets\UnitySlippyMap\Helpers\Zip.cs" />
7172
<Compile Include="Assets\UnitySlippyMap\Input\Input.cs" />
7273
<Compile Include="Assets\UnitySlippyMap\Layers\DBTileLayerBehaviour.cs" />
7374
<Compile Include="Assets\UnitySlippyMap\Layers\LayerBehaviour.cs" />
@@ -83,18 +84,25 @@
8384
<Compile Include="Assets\UnitySlippyMap\Markers\LocationMarkerBehaviour.cs" />
8485
<Compile Include="Assets\UnitySlippyMap\Markers\MarkerBehaviour.cs" />
8586
<None Include="Assets\UnitySlippyMap\Dll\ProjNet.1.2\ProjNet.xml" />
87+
<None Include="Assets\UnitySlippyMap\Resources\Shaders\LarkuUnlitTransparent.shader" />
8688
<None Include="Assets\UnitySlippyMap\Resources\Shaders\SomianUnlitTransparent.shader" />
8789
<None Include="Assets\UnitySlippyMap\Resources\SRID.txt" />
8890
<Reference Include="UnityEngine.UI">
89-
<HintPath>/Applications/Unity 4/Unity.app/Contents/UnityExtensions/Unity/GUISystem/4.6.8/Standalone/UnityEngine.UI.dll</HintPath>
91+
<HintPath>C:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
92+
</Reference>
93+
<Reference Include="UnityEngine.Networking">
94+
<HintPath>C:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
95+
</Reference>
96+
<Reference Include="ICSharpCode.SharpZipLib">
97+
<HintPath>C:/Users/pixelfat/Documents/repos/git/UnitySlippyMap-pull/Assets/UnitySlippyMap/Dll/ICSharpCode.SharpZipLib.dll</HintPath>
9098
</Reference>
9199
<Reference Include="ProjNet">
92-
<HintPath>/Users/jonathan/Documents/UnitySlippyMap/Assets/UnitySlippyMap/Dll/ProjNet.1.2/ProjNet.dll</HintPath>
100+
<HintPath>C:/Users/pixelfat/Documents/repos/git/UnitySlippyMap-pull/Assets/UnitySlippyMap/Dll/ProjNet.1.2/ProjNet.dll</HintPath>
93101
</Reference>
94102
</ItemGroup>
95103
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
96104
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
97-
Other similar extension points exist, see Microsoft.Common.targets.
105+
Other similar extension points exist, see Microsoft.Common.targets.
98106
<Target Name="BeforeBuild">
99107
</Target>
100108
<Target Name="AfterBuild">
Binary file not shown.

Assets/StreamingAssets/MBTiles/CountryMapWithUTfData.mbtiles.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/TestScripts/TestMap.cs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// You should have received a copy of the GNU Lesser General Public License
2020
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2121

22+
// #define DEBUG_LOG
23+
2224
using UnityEngine;
2325

2426
using System;
@@ -53,7 +55,9 @@ public class TestMap : MonoBehaviour
5355

5456
private List<LayerBehaviour> layers;
5557
private int currentLayerIndex = 0;
56-
58+
59+
private string utfGridJsonString = "";
60+
5761
bool Toolbar(MapBehaviour map)
5862
{
5963
GUI.matrix = Matrix4x4.Scale(new Vector3(guiXScale, guiXScale, 1.0f));
@@ -148,8 +152,13 @@ bool Toolbar(MapBehaviour map)
148152
GUILayout.EndHorizontal();
149153

150154
GUILayout.EndArea();
151-
155+
156+
// Show any mbtiles utf string under the mouse position
157+
if (!string.IsNullOrEmpty(utfGridJsonString))
158+
GUILayout.Label(utfGridJsonString);
159+
152160
return pressed;
161+
153162
}
154163

155164
private
@@ -219,7 +228,8 @@ bool Toolbar(MapBehaviour map)
219228
bool error = false;
220229
// on iOS, you need to add the db file to the Xcode project using a directory reference
221230
string mbTilesDir = "MBTiles/";
222-
string filename = "UnitySlippyMap_World_0_8.mbtiles";
231+
//string filename = "UnitySlippyMap_World_0_8.mbtiles";
232+
string filename = "CountryMapWithUTfData.mbtiles";
223233
string filepath = null;
224234
if (Application.platform == RuntimePlatform.IPhonePlayer)
225235
{
@@ -279,8 +289,8 @@ bool Toolbar(MapBehaviour map)
279289

280290
// create some test 2D markers
281291
GameObject go = TileBehaviour.CreateTileTemplate(TileBehaviour.AnchorPoint.BottomCenter).gameObject;
282-
go.renderer.material.mainTexture = MarkerTexture;
283-
go.renderer.material.renderQueue = 4001;
292+
go.GetComponent<Renderer>().material.mainTexture = MarkerTexture;
293+
go.GetComponent<Renderer>().material.renderQueue = 4001;
284294
go.transform.localScale = new Vector3(0.70588235294118f, 1.0f, 1.0f);
285295
go.transform.localScale /= 7.0f;
286296
go.AddComponent<CameraFacingBillboard>().Axis = Vector3.up;
@@ -299,8 +309,8 @@ bool Toolbar(MapBehaviour map)
299309

300310
// create the location marker
301311
go = TileBehaviour.CreateTileTemplate().gameObject;
302-
go.renderer.material.mainTexture = LocationTexture;
303-
go.renderer.material.renderQueue = 4000;
312+
go.GetComponent<Renderer>().material.mainTexture = LocationTexture;
313+
go.GetComponent<Renderer>().material.renderQueue = 4000;
304314
go.transform.localScale /= 27.0f;
305315

306316
markerGO = Instantiate(go) as GameObject;
@@ -335,6 +345,12 @@ void Update()
335345

336346
map.HasMoved = true;
337347
}
348+
349+
// if (Input.GetMouseButtonDown(0))
350+
foreach (LayerBehaviour _lb in layers)
351+
if (_lb.GetType() == typeof(MBTilesLayerBehaviour))
352+
utfGridJsonString = ((MBTilesLayerBehaviour)_lb).UtfGridJsonString();
353+
338354
}
339355

340356
#if DEBUG_PROFILE
Binary file not shown.

Assets/UnitySlippyMap/Dll/ICSharpCode.SharpZipLib.dll.meta

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UnitySlippyMap/Dll/ProjNet.1.2.meta

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UnitySlippyMap/Dll/sqlite3.dll

650 KB
Binary file not shown.

Assets/UnitySlippyMap/Dll/sqlite3.dll.meta

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)