diff --git a/OsmSharp.Android.UI/Data/SQLite/SQLiteConnection.cs b/OsmSharp.Android.UI/Data/SQLite/SQLiteConnection.cs
index 9120cfdc..d713bd5e 100644
--- a/OsmSharp.Android.UI/Data/SQLite/SQLiteConnection.cs
+++ b/OsmSharp.Android.UI/Data/SQLite/SQLiteConnection.cs
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with OsmSharp. If not, see .
-using OsmSharp.Data.SQLite;
+using OsmSharp.UI.Data.SQLite;
using System.IO;
using System.Reflection;
@@ -25,7 +25,7 @@ namespace OsmSharp.Android.UI.Data.SQLite
///
/// An Android-specific implementation of an SQLiteConnection.
///
- public class SQLiteConnection : OsmSharp.Data.SQLite.SQLiteConnectionBase
+ public class SQLiteConnection : OsmSharp.UI.Data.SQLite.SQLiteConnectionBase
{
///
/// Holds the 'native' or platform-specific connection.
diff --git a/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj b/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj
index ca8accea..a5aa1794 100644
--- a/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj
+++ b/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj
@@ -38,12 +38,12 @@
..\OutputAndroid\OsmSharp.Android.UI.XML
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\MonoAndroid\OsmSharp.dll
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\MonoAndroid\OsmSharp.dll
True
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\MonoAndroid\OsmSharp.Osm.dll
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\MonoAndroid\OsmSharp.Osm.dll
True
diff --git a/OsmSharp.Android.UI/Resources/Resource.designer.cs b/OsmSharp.Android.UI/Resources/Resource.designer.cs
index ded6de21..d633e591 100644
--- a/OsmSharp.Android.UI/Resources/Resource.designer.cs
+++ b/OsmSharp.Android.UI/Resources/Resource.designer.cs
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34209
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
diff --git a/OsmSharp.Android.UI/packages.config b/OsmSharp.Android.UI/packages.config
index de5b7aeb..b98df203 100644
--- a/OsmSharp.Android.UI/packages.config
+++ b/OsmSharp.Android.UI/packages.config
@@ -1,7 +1,7 @@
-
+
\ No newline at end of file
diff --git a/OsmSharp.UI.Test/OsmSharp.UI.Test.csproj b/OsmSharp.UI.Test/OsmSharp.UI.Test.csproj
index 220f49ae..737d9e66 100644
--- a/OsmSharp.UI.Test/OsmSharp.UI.Test.csproj
+++ b/OsmSharp.UI.Test/OsmSharp.UI.Test.csproj
@@ -64,12 +64,16 @@
..\packages\Antlr3.Runtime.PCL.3.5.0.3\lib\portable-win+net40+sl40+wp\Antlr3.Runtime.dll
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\net40\OsmSharp.dll
+
+ ..\packages\NUnit.3.0.1\lib\net40\nunit.framework.dll
True
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\net40\OsmSharp.Osm.dll
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\net40\OsmSharp.dll
+ True
+
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\net40\OsmSharp.Osm.dll
True
@@ -82,9 +86,6 @@
-
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
..\packages\Zlib.Portable.1.9.2\lib\portable-net4+sl4+wp71+win8\Zlib.Portable.dll
True
@@ -139,5 +140,7 @@
-->
-
+
+
+
\ No newline at end of file
diff --git a/OsmSharp.UI.Test/packages.config b/OsmSharp.UI.Test/packages.config
index 1fad1be4..c65cd619 100644
--- a/OsmSharp.UI.Test/packages.config
+++ b/OsmSharp.UI.Test/packages.config
@@ -1,8 +1,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/OsmSharp.UI.sln b/OsmSharp.UI.sln
index 866cc527..9af515dd 100644
--- a/OsmSharp.UI.sln
+++ b/OsmSharp.UI.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OsmSharp.WinForms.UI", "OsmSharp.WinForms.UI\OsmSharp.WinForms.UI.csproj", "{1433D177-B342-463C-8128-8399720A35AF}"
EndProject
@@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OsmSharp.UI", "OsmSharp.UI\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OsmSharp.UI.Test", "OsmSharp.UI.Test\OsmSharp.UI.Test.csproj", "{0739A23C-1D40-477F-AE7C-38518B499567}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OsmSharp.Wpf.UI", "OsmSharp.Wpf.UI\OsmSharp.Wpf.UI.csproj", "{141C2CD0-6A13-43C2-9924-D2217E88AA88}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OsmSharp.Wpf.UI.Sample", "OsmSharp.Wpf.UI.Sample\OsmSharp.Wpf.UI.Sample.csproj", "{3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -53,6 +57,30 @@ Global
{0739A23C-1D40-477F-AE7C-38518B499567}.Release|x64.Build.0 = Release|x64
{0739A23C-1D40-477F-AE7C-38518B499567}.Release|x86.ActiveCfg = Release|x86
{0739A23C-1D40-477F-AE7C-38518B499567}.Release|x86.Build.0 = Release|x86
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|x64.Build.0 = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Debug|x86.Build.0 = Debug|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|Any CPU.Build.0 = Release|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|x64.ActiveCfg = Release|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|x64.Build.0 = Release|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|x86.ActiveCfg = Release|Any CPU
+ {141C2CD0-6A13-43C2-9924-D2217E88AA88}.Release|x86.Build.0 = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|x64.Build.0 = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Debug|x86.Build.0 = Debug|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|x64.ActiveCfg = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|x64.Build.0 = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|x86.ActiveCfg = Release|Any CPU
+ {3E2BD0D5-1EE6-4023-8880-78B451B6AEE1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/OsmSharp.UI/Data/SQLite/SQLiteConnectionBase.cs b/OsmSharp.UI/Data/SQLite/SQLiteConnectionBase.cs
new file mode 100644
index 00000000..7b52e01e
--- /dev/null
+++ b/OsmSharp.UI/Data/SQLite/SQLiteConnectionBase.cs
@@ -0,0 +1,44 @@
+// OsmSharp - OpenStreetMap (OSM) SDK
+// Copyright (C) 2016 Abelshausen Ben
+//
+// This file is part of OsmSharp.
+//
+// OsmSharp is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// OsmSharp 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with OsmSharp. If not, see .
+
+using System;
+using System.Collections.Generic;
+
+namespace OsmSharp.UI.Data.SQLite
+{
+ ///
+ /// A wrapper-class for all platform-specific SQLite connections.
+ ///
+ public abstract class SQLiteConnectionBase : IDisposable
+ {
+ ///
+ /// Creates an SQLLite command.
+ ///
+ public abstract List Query(string query, params object[] args) where T : new();
+
+ ///
+ /// Disposes of all resources associated with this connection.
+ ///
+ public abstract void Dispose();
+
+ ///
+ /// Closes this SQLite command.
+ ///
+ public abstract void Close();
+ }
+}
\ No newline at end of file
diff --git a/OsmSharp.UI/IMapView.cs b/OsmSharp.UI/IMapView.cs
index a8c5870d..604b96b9 100644
--- a/OsmSharp.UI/IMapView.cs
+++ b/OsmSharp.UI/IMapView.cs
@@ -21,7 +21,6 @@
using OsmSharp.UI.Animations;
using OsmSharp.Math.Geo.Projections;
using OsmSharp.UI.Renderer;
-using System;
namespace OsmSharp.UI
{
diff --git a/OsmSharp.UI/Map/Layers/Layer.cs b/OsmSharp.UI/Map/Layers/Layer.cs
index bebe441a..ad82369a 100644
--- a/OsmSharp.UI/Map/Layers/Layer.cs
+++ b/OsmSharp.UI/Map/Layers/Layer.cs
@@ -83,7 +83,7 @@ public bool IsLayerVisibleFor(float zoomLevel)
///
///
///
- protected internal abstract IEnumerable Get(float zoomFactor, View2D view);
+ public abstract IEnumerable Get(float zoomFactor, View2D view);
///
/// Called when the view on the map has changed.
@@ -93,15 +93,14 @@ public bool IsLayerVisibleFor(float zoomLevel)
///
///
///
- protected internal virtual void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public virtual void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
// override in layer implementation if needed.
}
-
///
/// Called when the last map view change has to be cancelled.
///
- protected internal virtual void ViewChangedCancel()
+ public virtual void ViewChangedCancel()
{
// override in layer implementation to cancel large map requests.
}
@@ -124,7 +123,7 @@ protected void RaiseLayerChanged()
///
/// An event raised when the content of this layer has changed.
///
- protected internal event OsmSharp.UI.Map.Map.LayerChanged LayerChanged;
+ public event Map.LayerChanged LayerChanged;
///
/// Holds the visible flag.
@@ -156,6 +155,7 @@ public bool IsVisible
///
public object Tag { get; set; }
+
///
/// Pauses all activities in this layer.
///
diff --git a/OsmSharp.UI/Map/Layers/LayerGpx.cs b/OsmSharp.UI/Map/Layers/LayerGpx.cs
index 11ce6d26..2d101e88 100644
--- a/OsmSharp.UI/Map/Layers/LayerGpx.cs
+++ b/OsmSharp.UI/Map/Layers/LayerGpx.cs
@@ -57,7 +57,7 @@ public LayerGpx(IProjection projection)
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
// all data is pre-loaded for now.
@@ -70,7 +70,7 @@ protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoord
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
return _scene.Get(view, zoomFactor);
}
diff --git a/OsmSharp.UI/Map/Layers/LayerMBTile.cs b/OsmSharp.UI/Map/Layers/LayerMBTile.cs
index a02a583d..67f08e7a 100644
--- a/OsmSharp.UI/Map/Layers/LayerMBTile.cs
+++ b/OsmSharp.UI/Map/Layers/LayerMBTile.cs
@@ -23,7 +23,7 @@
using OsmSharp.UI.Renderer;
using OsmSharp.Math.Geo;
using OsmSharp.Osm.Tiles;
-using OsmSharp.Data.SQLite;
+using OsmSharp.UI.Data.SQLite;
using OsmSharp.Collections.Cache;
using OsmSharp.UI.Renderer.Primitives;
using OsmSharp.Math.Geo.Projections;
@@ -114,7 +114,7 @@ private void OnRemove(Image2D image)
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
var primitives = new List();
lock (_cache)
@@ -147,7 +147,7 @@ protected internal override IEnumerable Get(float zoomFactor, View2
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
// calculate the current zoom level.
var zoomLevel = (int)System.Math.Round(map.Projection.ToZoomLevel(zoomFactor), 0);
diff --git a/OsmSharp.UI/Map/Layers/LayerOsm.cs b/OsmSharp.UI/Map/Layers/LayerOsm.cs
index 821e68f2..34f2cac3 100644
--- a/OsmSharp.UI/Map/Layers/LayerOsm.cs
+++ b/OsmSharp.UI/Map/Layers/LayerOsm.cs
@@ -68,7 +68,7 @@ public LayerOsm(IDataSourceReadOnly dataSource, StyleInterpreter styleInterprete
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
this.BuildScene(map, zoomFactor, center, extraView);
}
@@ -79,7 +79,7 @@ protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoord
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
return _styleSceneManager.Scene.Get(view, zoomFactor);
}
diff --git a/OsmSharp.UI/Map/Layers/LayerPrimitives.cs b/OsmSharp.UI/Map/Layers/LayerPrimitives.cs
index 0a9f2c13..ed9aae5b 100644
--- a/OsmSharp.UI/Map/Layers/LayerPrimitives.cs
+++ b/OsmSharp.UI/Map/Layers/LayerPrimitives.cs
@@ -278,7 +278,7 @@ public void Clear()
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
// all data is preloaded for now.
@@ -291,7 +291,7 @@ protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoord
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
return _scene.Get(view, zoomFactor);
}
diff --git a/OsmSharp.UI/Map/Layers/LayerScene.cs b/OsmSharp.UI/Map/Layers/LayerScene.cs
index 68da04c0..958a2d04 100644
--- a/OsmSharp.UI/Map/Layers/LayerScene.cs
+++ b/OsmSharp.UI/Map/Layers/LayerScene.cs
@@ -58,7 +58,7 @@ public LayerScene(IPrimitives2DSource index)
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
this.BuildScene(map, zoomFactor, center, extraView);
}
@@ -66,7 +66,7 @@ protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoord
///
/// Called when the last map view change has to be cancelled.
///
- protected internal override void ViewChangedCancel()
+ public override void ViewChangedCancel()
{ // cancel the current get if there is one going on.
_index.GetCancel();
}
@@ -136,7 +136,7 @@ private void BuildScene(Map map, float zoomFactor, GeoCoordinate center, View2D
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
return _primitives.Where((primitive) =>
{
diff --git a/OsmSharp.UI/Map/Layers/LayerTile.cs b/OsmSharp.UI/Map/Layers/LayerTile.cs
index 7c4c836f..50b1bf43 100644
--- a/OsmSharp.UI/Map/Layers/LayerTile.cs
+++ b/OsmSharp.UI/Map/Layers/LayerTile.cs
@@ -223,10 +223,12 @@ private void LoadTile(object state)
request.BeginGetResponse(new AsyncCallback((iar) =>
{
- var response = (HttpWebResponse)((HttpWebRequest)iar.AsyncState).EndGetResponse(iar);
+ HttpWebResponse response = null;
try
{
- this.Response(response, tile);
+ response = ((HttpWebRequest)iar.AsyncState).EndGetResponse(iar);
+
+ this.Response(response, tile);
_loading.Remove(tile);
}
@@ -275,7 +277,7 @@ private void LoadTile(object state)
}
finally
{
- response.Close();
+ response?.Close();
}
}), request);
}
@@ -382,13 +384,13 @@ private void Response(HttpWebResponse myResp, Tile tile)
///
///
///
- protected internal override IEnumerable Get(float zoomFactor, View2D view)
+ public override IEnumerable Get(float zoomFactor, View2D view)
{
var primitives = new List();
- if(_suspended)
- { // just return an empty primitives list if suspended.
- return primitives;
- }
+ //if(_suspended)
+ //{ // just return an empty primitives list if suspended.
+ // return primitives;
+ //}
try
{
// calculate the current zoom level.
@@ -511,7 +513,7 @@ int IComparer.Compare(Primitive2D x, Primitive2D y)
///
///
///
- protected internal override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
+ public override void ViewChanged(Map map, float zoomFactor, GeoCoordinate center, View2D view, View2D extraView)
{
if (_suspended)
{ // do not accept trigger changes if suspended.
diff --git a/OsmSharp.UI/Map/Styles/MapCSS/MapCSSInterpreter.cs b/OsmSharp.UI/Map/Styles/MapCSS/MapCSSInterpreter.cs
index ab41d498..564071af 100644
--- a/OsmSharp.UI/Map/Styles/MapCSS/MapCSSInterpreter.cs
+++ b/OsmSharp.UI/Map/Styles/MapCSS/MapCSSInterpreter.cs
@@ -136,19 +136,19 @@ private void PrepareForProcessing()
switch (selector.Type)
{
case SelectorTypeEnum.Node:
- _keysForNodes = null;
+ _keysForNodes.Add("*");
break;
case SelectorTypeEnum.Way:
- _keysForWays = null;
+ _keysForWays.Add("*");
break;
case SelectorTypeEnum.Relation:
- _keysForRelations = null;
+ _keysForRelations.Add("*");
break;
case SelectorTypeEnum.Line:
- _keysForLines = null;
+ _keysForLines.Add("*");
break;
case SelectorTypeEnum.Area:
- _keysForAreas = null;
+ _keysForAreas.Add("*");
break;
}
}
@@ -299,12 +299,7 @@ public override void Translate(Scene2D scene, IProjection projection, ICompleteO
{
case CompleteOsmType.Node:
if (!_mapCSSFile.HasNodeIdSelector &&
- osmGeo.Tags.Count == 0)
- { // this node can never be selected, no tags and no id selectors.
- break;
- }
- if (!_mapCSSFile.HasNodeIdSelector &&
- _keysForNodes != null &&
+ !_keysForNodes.Contains("*") &&
!osmGeo.Tags.ContainsOneOfKeys(_keysForNodes))
{ // no good keys present.
break;
@@ -312,13 +307,9 @@ public override void Translate(Scene2D scene, IProjection projection, ICompleteO
this.TranslateNode(scene, projection, osmGeo as Node);
break;
case CompleteOsmType.Way:
- var relevantWayTags = osmGeo.Tags;
- if (_keysForWays != null)
- { // filter the collection.
- relevantWayTags = relevantWayTags.KeepKeysOf(_keysForWays);
- }
+ var relevantWayTags = osmGeo.Tags.KeepKeysOf(_keysForWays);
if (!_mapCSSFile.HasWayIdSelector &&
- _keysForWays != null &&
+ !_keysForWays.Contains("*") &&
relevantWayTags.Count == 0)
{ // no good keys present.
break;
@@ -334,7 +325,7 @@ public override void Translate(Scene2D scene, IProjection projection, ICompleteO
break;
case CompleteOsmType.Relation:
if (!_mapCSSFile.HasRelationIdSelector &&
- _keysForRelations != null &&
+ !_keysForRelations.Contains("*") &&
!osmGeo.Tags.ContainsOneOfKeys(_keysForRelations))
{ // no good keys present.
break;
diff --git a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Domain/DeclarationTextPosition.cs b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Domain/DeclarationTextPosition.cs
index 5032ad5c..559e6e9c 100644
--- a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Domain/DeclarationTextPosition.cs
+++ b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Domain/DeclarationTextPosition.cs
@@ -28,6 +28,7 @@ public enum DeclarationTextPositionEnum
public enum TextPositionEnum
{
Line,
- Center
+ Center,
+ Offset
}
}
diff --git a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Eval/EvalInterpreter.cs b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Eval/EvalInterpreter.cs
index 55bbba05..32804c4f 100644
--- a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Eval/EvalInterpreter.cs
+++ b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/Eval/EvalInterpreter.cs
@@ -12,6 +12,8 @@ namespace OsmSharp.UI.Map.Styles.MapCSS.v0_2.Eval
///
public class EvalInterpreter
{
+ #region instance
+
///
/// Creates a new eval interpreter.
///
@@ -40,34 +42,67 @@ public static EvalInterpreter Instance
}
}
- private const string TAG_TOKEN = "tag";
-
- private const string PROP_TOKEN = "prop";
-
- private const string COND_TOKEN = "cond";
+ #endregion instance
- private const string ANY_TOKEN = "any";
+ #region atomar
- private const string MAX_TOKEN = "max";
-
- private const string MIN_TOKEN = "min";
+ ///
+ /// Interpreters the given eval function.
+ ///
+ /// The string.
+ /// Eval function.
+ /// Tags.
+ public string InterpretString(string evalFunction, ITagsSource tags)
+ {
+ if (string.IsNullOrWhiteSpace(evalFunction)) { throw new ArgumentOutOfRangeException("evalFunction cannot be null"); }
- ///
- /// Interpreters the given eval function.
- ///
- /// The string.
- /// Eval function.
- /// Tags.
- public string InterpretString(string evalFunction, ITagsSource tags){
- if (string.IsNullOrWhiteSpace(evalFunction)) { throw new ArgumentOutOfRangeException("evalFunction cannot be null"); }
+ // trim eval function.
+ evalFunction = evalFunction.Trim();
- // trim eval function.
- evalFunction = evalFunction.Trim();
+ // calculate the result.
+ return this.Interpreter(evalFunction, tags);
+ }
+
+ ///
+ /// Interpreters the given eval function.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public double InterpretDouble(string evalFunction, ITagsSource tags)
+ {
+ string result = this.InterpretString(evalFunction, tags);
- // calculate the result.
- return this.Interpreter (evalFunction, tags);
- }
+ // parse to double.
+ double resultDouble = 0;
+ if (!double.TryParse(result, out resultDouble))
+ {
+ OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
+ string.Format("Cannot convert '{0}' to double.", result));
+ }
+ return resultDouble;
+ }
+ ///
+ /// Interpreters the given eval function.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public float InterpretFloat(string evalFunction, ITagsSource tags)
+ {
+ string result = this.InterpretString(evalFunction, tags);
+ // parse to float.
+ float resultFloat = 0;
+ if (!float.TryParse(result, out resultFloat))
+ {
+ OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
+ string.Format("Cannot convert '{0}' to float.", result));
+ }
+ return resultFloat;
+ }
///
/// Interpreters the given eval function.
///
@@ -75,58 +110,44 @@ public string InterpretString(string evalFunction, ITagsSource tags){
///
///
///
- public double InterpretDouble(string evalFunction, ITagsSource tags)
+ public int InterpretInt(string evalFunction, ITagsSource tags)
+ {
+ string result = this.InterpretString(evalFunction, tags);
+
+ // parse to double.
+ int resultInt = 0;
+ if (!int.TryParse(result, out resultInt))
+ {
+ OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
+ string.Format("Cannot convert '{0}' to int.", result));
+ }
+ return resultInt;
+ }
+ ///
+ /// Returns the interpreted value of the boolstring according to the MapCSS eval boolean datatype rules.
+ ///
+ ///
+ ///
+ public bool InterpretBool(string evalFunction, ITagsSource tags)
{
- string result = this.InterpretString (evalFunction, tags);
+ string result = this.InterpretString(evalFunction, tags);
+ return !(result == null || result == "false" || result == string.Empty || result == "no");
+ }
+
- // parse to double.
- double resultDouble = 0;
- if (!double.TryParse (result, out resultDouble)) {
- OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
- string.Format ("Cannot convert '{0}' to double.", result));
- }
- return resultDouble;
- }
+ #endregion atomar
+
+ private const string TAG_TOKEN = "tag";
+
+ private const string PROP_TOKEN = "prop";
- ///
- /// Interpreters the given eval function.
- ///
- ///
- ///
- ///
- ///
- public float InterpretFloat(string evalFunction, ITagsSource tags)
- {
- string result = this.InterpretString (evalFunction, tags);
+ private const string COND_TOKEN = "cond";
- // parse to float.
- float resultFloat = 0;
- if (!float.TryParse (result, out resultFloat)) {
- OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
- string.Format ("Cannot convert '{0}' to float.", result));
- }
- return resultFloat;
- }
+ private const string ANY_TOKEN = "any";
- ///
- /// Interpreters the given eval function.
- ///
- ///
- ///
- ///
- ///
- public int InterpretInt(string evalFunction, ITagsSource tags)
- {
- string result = this.InterpretString (evalFunction, tags);
+ private const string MAX_TOKEN = "max";
- // parse to double.
- int resultInt = 0;
- if (!int.TryParse (result, out resultInt)) {
- OsmSharp.Logging.Log.TraceEvent("EvalInterpreter", OsmSharp.Logging.TraceEventType.Error,
- string.Format ("Cannot convert '{0}' to int.", result));
- }
- return resultInt;
- }
+ private const string MIN_TOKEN = "min";
///
/// Interpreters the given expression.
@@ -157,7 +178,7 @@ private string Interpreter(string expression, ITagsSource tags)
{ // evaluate expression and decide on the next expression.
string[] args = this.ParseFunction(expression);
if (args.Length != 3) { throw new EvalInterpreterException("Invalid argument count: {0}", expression); }
- if (this.ParseBool(this.Interpreter(args[0], tags)))
+ if (this.InterpretBool(this.Interpreter(args[0], tags)))
{ // evaluate and return the true-part.
return this.Interpreter(args[1], tags);
}
@@ -182,12 +203,35 @@ private string Interpreter(string expression, ITagsSource tags)
}
else if (expression.StartsWith(MAX_TOKEN))
{ // returns the maximum value of all arguments.
+ string[] args = this.ParseFunction(expression);
+ return null;
}
else if (expression.StartsWith(MIN_TOKEN))
{ // returns the minimum value of all arguments.
-
+ return null;
}
+ //else if (expression.StartsWith(NUM_TOKEN))
+ //{ // returns the minimum value of all arguments.
+ // return null;
+ //}
+ //else if (expression.StartsWith(STR_TOKEN))
+ //{ // returns the minimum value of all arguments.
+ // return null;
+ //}
+ //else if (expression.StartsWith(BOOLEAN_TOKEN))
+ //{ // returns the minimum value of all arguments.
+ // return null;
+ //}
+ //else if (expression.StartsWith(INT_TOKEN))
+ //{ // returns the minimum value of all arguments.
+ // return null;
+ //}
+
+ //metric
+ // sqrt
+ // concat
+ return null;
throw new EvalInterpreterException("Failed to evaluate expression: {0}", expression);
}
@@ -238,25 +282,24 @@ private float EvaluateNumber(string number)
}
return result;
}
-
///
- /// Returns true if the given string represents none.
+ /// Returns the interpreted value of the boolstring according to the MapCSS eval boolean datatype rules.
///
- ///
+ ///
///
- private bool IsNone(string noneString)
+ public bool InterpretBool(string boolean)
{
- return noneString == null || noneString == string.Empty;
+ return !(boolean == null || boolean == "false" || boolean == string.Empty || boolean == "no");
}
///
- /// Returns the interpreted value of the boolstring according to the MapCSS eval boolean datatype rules.
+ /// Returns true if the given string represents none.
///
- ///
+ ///
///
- private bool ParseBool(string boolString)
+ private bool IsNone(string noneString)
{
- return !(boolString == null || boolString == "false" || boolString == string.Empty || boolString == "no");
+ return string.IsNullOrEmpty(noneString);
}
///
diff --git a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/MapCSSDomainParser.cs b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/MapCSSDomainParser.cs
index a729977b..4a513207 100644
--- a/OsmSharp.UI/Map/Styles/MapCSS/v0_2/MapCSSDomainParser.cs
+++ b/OsmSharp.UI/Map/Styles/MapCSS/v0_2/MapCSSDomainParser.cs
@@ -436,6 +436,9 @@ private static Rule ParseRule(CommonTree ruleTree)
case "center":
textPosition.Value = TextPositionEnum.Center;
break;
+ case "offset":
+ textPosition.Value = TextPositionEnum.Offset;
+ break;
default:
throw new MapCSSDomainParserException(declarationTree,
string.Format("{1} value {0} cannot be parsed!", valueString, qualifierString));
diff --git a/OsmSharp.UI/OsmSharp.UI.csproj b/OsmSharp.UI/OsmSharp.UI.csproj
index e377ba39..1e77f455 100644
--- a/OsmSharp.UI/OsmSharp.UI.csproj
+++ b/OsmSharp.UI/OsmSharp.UI.csproj
@@ -71,6 +71,7 @@
+
@@ -173,12 +174,12 @@
..\packages\Antlr3.Runtime.PCL.3.5.0.3\lib\portable-win+net40+sl40+wp\Antlr3.Runtime.dll
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.dll
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\portable-net403+sl50+win+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10\OsmSharp.dll
True
-
- ..\packages\OsmSharp.Core.0.0.0.48-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.Osm.dll
+
+ ..\packages\OsmSharp.Core.1.3.0-rc1-0119\lib\portable-net403+sl50+win+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10\OsmSharp.Osm.dll
True
diff --git a/OsmSharp.UI/Renderer/Primitives/Icon2D.cs b/OsmSharp.UI/Renderer/Primitives/Icon2D.cs
index 65830348..f8f13d21 100644
--- a/OsmSharp.UI/Renderer/Primitives/Icon2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/Icon2D.cs
@@ -76,12 +76,6 @@ public override Primitive2DType Primitive2DType
get { return Primitives.Primitive2DType.Icon2D; }
}
- ///
- /// Gets or sets the tag.
- ///
- /// The tag.
- public object Tag { get; set; }
-
///
/// Gets or sets the x.
///
diff --git a/OsmSharp.UI/Renderer/Primitives/Line2D.cs b/OsmSharp.UI/Renderer/Primitives/Line2D.cs
index 08f47008..b4ae4b0b 100644
--- a/OsmSharp.UI/Renderer/Primitives/Line2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/Line2D.cs
@@ -169,16 +169,6 @@ public override Primitive2DType Primitive2DType
get { return Primitives.Primitive2DType.Line2D; }
}
- ///
- /// Gets or sets the tag.
- ///
- /// The tag.
- public object Tag
- {
- get;
- set;
- }
-
///
/// Gets or sets the x.
///
diff --git a/OsmSharp.UI/Renderer/Primitives/LineText2D.cs b/OsmSharp.UI/Renderer/Primitives/LineText2D.cs
index 92160652..5311d0b6 100644
--- a/OsmSharp.UI/Renderer/Primitives/LineText2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/LineText2D.cs
@@ -168,12 +168,6 @@ public override Primitive2DType Primitive2DType
get { return Primitives.Primitive2DType.LineText2D; }
}
- ///
- /// Gets or sets the tag.
- ///
- /// The tag.
- public object Tag { get; set; }
-
///
/// Gets or sets the text.
///
diff --git a/OsmSharp.UI/Renderer/Primitives/Point2D.cs b/OsmSharp.UI/Renderer/Primitives/Point2D.cs
index 3f6ca04c..5a30c20e 100644
--- a/OsmSharp.UI/Renderer/Primitives/Point2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/Point2D.cs
@@ -59,16 +59,6 @@ public override Primitive2DType Primitive2DType
get { return Primitives.Primitive2DType.Point2D; }
}
- ///
- /// Gets or sets the tag.
- ///
- /// The tag.
- public object Tag
- {
- get;
- set;
- }
-
///
/// Gets or sets the x.
///
diff --git a/OsmSharp.UI/Renderer/Primitives/Polygon2D.cs b/OsmSharp.UI/Renderer/Primitives/Polygon2D.cs
index c59137c8..d43e05aa 100644
--- a/OsmSharp.UI/Renderer/Primitives/Polygon2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/Polygon2D.cs
@@ -164,16 +164,6 @@ public override Primitive2DType Primitive2DType
get { return Primitives.Primitive2DType.Polygon2D; }
}
- ///
- /// Gets or sets the tag.
- ///
- /// The tag.
- public object Tag
- {
- get;
- set;
- }
-
///
/// Gets or sets the x.
///
diff --git a/OsmSharp.UI/Renderer/Primitives/Primitive2D.cs b/OsmSharp.UI/Renderer/Primitives/Primitive2D.cs
index 957e84ae..21a0cd92 100644
--- a/OsmSharp.UI/Renderer/Primitives/Primitive2D.cs
+++ b/OsmSharp.UI/Renderer/Primitives/Primitive2D.cs
@@ -16,6 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with OsmSharp. If not, see .
+using System;
using OsmSharp.Math.Primitives;
namespace OsmSharp.UI.Renderer.Primitives
@@ -55,5 +56,21 @@ public abstract class Primitive2D
/// Gets or sets the layer.
///
public uint Layer { get; set; }
+
+ ///
+ /// Gets or sets the tag.
+ ///
+ /// The tag.
+ public object Tag { get; set; }
+
+ ///
+ /// Gets or sets the tool tip.
+ ///
+ /// The tag.
+ public object ToolTip { get; set; }
+ ///
+ /// ToolTip creater
+ ///
+ public Func