diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index 2a862bee..37189984 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -113,19 +113,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -198,10 +197,7 @@
-
-
- False
-
+
diff --git a/CampusAppWP8/CampusAppWP8/File/Campusmap/BuildingsMaps.xml b/CampusAppWP8/CampusAppWP8/File/Campusmap/BuildingsMaps.xml
index b8ab9ab9..a7f1afea 100644
--- a/CampusAppWP8/CampusAppWP8/File/Campusmap/BuildingsMaps.xml
+++ b/CampusAppWP8/CampusAppWP8/File/Campusmap/BuildingsMaps.xml
@@ -10,7 +10,7 @@
800
-288
-390
- Point(430 500)
+ Point(410, 480)
650000
1200000
@@ -24,7 +24,7 @@
800
-252
-390
- Point(235 380)
+ Point(215, 355)
300000
500000
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs
deleted file mode 100644
index a98fb364..00000000
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//-----------------------------------------------------------------------
-//
-// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
-//
-// Stubbfel
-// 14.10.2013
-// Implements the main map room model class
-//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
-{
- /// Class for the MapModel of the mainCampus of cottbus.
- /// Stubbfel, 14.10.2013.
- public class CBMainMapRoomModel
- {
- #region Constructor
-
- /// Initializes a new instance of the CBMainMapRoomModel class.
- /// Stubbfel, 14.10.2013.
- public CBMainMapRoomModel()
- {
- }
-
- #endregion
- }
-}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/BuildingMapModel.cs
similarity index 78%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/BuildingMapModel.cs
index d24d18d4..0aa09ac9 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/BuildingMapModel.cs
@@ -6,7 +6,7 @@
// 14.10.2013
// Implements the building map model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Map
{
using System.Globalization;
using System.Linq;
@@ -14,11 +14,12 @@ namespace CampusAppWP8.Model.Campusmap
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Utility;
+ using CampusAppWPortalLib8.Model.Utility;
/// A data Model for the building map.
/// Stubbfel, 14.10.2013.
///
- public class BuildingMapModel : MapModel
+ public class BuildingMapModel : MapWp8Model
{
/// Initializes a new instance of the BuildingMapModel class.
/// Stubbfel, 14.10.2013.
@@ -34,6 +35,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = building.GetInformationsValue("ImageSource");
double tmpVal;
+
if (double.TryParse(building.GetInformationsValue("ImageWidth"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
{
this.ImageWidth = tmpVal;
@@ -44,16 +46,6 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageHeight = tmpVal;
}
- if (double.TryParse(building.GetInformationsValue("MapImageOffsetX"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
- {
- this.MapImageOffsetX = tmpVal;
- }
-
- if (double.TryParse(building.GetInformationsValue("MapImageOffsetY"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
- {
- this.MapImageOffsetY = tmpVal;
- }
-
string pointString = building.GetInformationsValue("MapRefPoint");
pointString = pointString.TrimStart("Point(".ToArray());
pointString = pointString.TrimEnd(')');
@@ -66,25 +58,26 @@ namespace CampusAppWP8.Model.Campusmap
double x;
double y;
+ if (double.TryParse(building.GetInformationsValue("MapImageOffsetX"), NumberStyles.Number, CultureInfo.InvariantCulture, out x)
+ && double.TryParse(building.GetInformationsValue("MapImageOffsetY"), NumberStyles.Number, CultureInfo.InvariantCulture, out y))
+ {
+ this.MapImageOffsetPoint = new MapPoint(x, y);
+ }
+
if (!double.TryParse(coord[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x) || !double.TryParse(coord[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y))
{
return;
}
- this.RefPoint = new Point(x, y);
+ this.RefPoint = new MapPoint(x, y);
- if (double.TryParse(building.GetInformationsValue("ScaleX"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
+ if (double.TryParse(building.GetInformationsValue("ScaleX"), NumberStyles.Number, CultureInfo.InvariantCulture, out x)
+ && double.TryParse(building.GetInformationsValue("ScaleY"), NumberStyles.Number, CultureInfo.InvariantCulture, out y))
{
- this.ScaleX = tmpVal;
+ this.ScalePoint = new MapPoint(x, y);
}
- if (double.TryParse(building.GetInformationsValue("ScaleY"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
- {
- this.ScaleY = tmpVal;
- }
-
- this.GeoOffsetX = building.GeoRefPoint.Longitude;
- this.GeoOffsetY = building.GeoRefPoint.Latitude;
+ this.GeoOffsetPoint = new MapPoint(building.GeoRefPoint.Longitude, building.GeoRefPoint.Latitude);
}
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CBMainMapModel.cs
similarity index 76%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CBMainMapModel.cs
index e92434e4..4d9c1e87 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CBMainMapModel.cs
@@ -6,12 +6,13 @@
// 14.10.2013
// Implements the main map model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Map
{
- using System.Collections.Generic;
- using System.Windows;
+ using System.Collections.Generic;
+ using System.Windows;
using CampusAppWP8.Model.GeoDb;
- using CampusAppWP8.Resources;
+ using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Utility;
/// Class for the MapModel of the mainCampus of cottbus.
/// Stubbfel, 14.10.2013.
@@ -36,13 +37,10 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Constants.FileMap_CBMainMap;
this.ImageWidth = 2000;
this.ImageHeight = 1425;
- this.MapImageOffsetX = -228;
- this.MapImageOffsetY = -300;
- this.RefPoint = new Point(1365, 800);
- this.ScaleX = 129483.4123222749;
- this.ScaleY = 197648.8919266073;
- this.GeoOffsetX = 14.327159;
- this.GeoOffsetY = 51.766548;
+ this.MapImageOffsetPoint = new MapPoint(-228, -300);
+ this.RefPoint = new MapPoint(1335, 775);
+ this.ScalePoint = new MapPoint(129483.4123222749, 197648.8919266073);
+ this.GeoOffsetPoint = new MapPoint(14.327159, 51.766548);
}
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CampusMapModel.cs
similarity index 96%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CampusMapModel.cs
index 3229f649..9d66fa9e 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/CampusMapModel.cs
@@ -6,7 +6,7 @@
// 14.10.2013
// Implements the campus map model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Map
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
@@ -14,7 +14,7 @@ namespace CampusAppWP8.Model.Campusmap
/// Class for the CampusMapModel.
/// Stubbfel, 14.10.2013.
///
- public class CampusMapModel : MapModel
+ public class CampusMapModel : MapWp8Model
{
#region constructor
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/MapWp8Model.cs
similarity index 57%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/MapWp8Model.cs
index e03d0a6d..3bb05881 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Maps/MapWp8Model.cs
@@ -6,7 +6,7 @@
// 14.10.2013
// Implements the map model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Map
{
using System;
using System.Collections.Generic;
@@ -15,24 +15,27 @@ namespace CampusAppWP8.Model.Campusmap
using System.Windows.Input;
using System.Windows.Media.Imaging;
using CampusAppWP8.Model.GeoDb;
+ using CampusAppWP8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Utility;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// This Class manage the properties of a Map.
/// Stubbfel, 14.10.2013.
- public class MapModel
+ public class MapWp8Model : CampusAppWPortalLib8.Model.Campusmap.Map.MapModel
{
#region Constructors
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
/// Stubbfel, 14.10.2013.
- public MapModel()
+ public MapWp8Model()
{
this.IsReady = false;
}
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
/// Stubbfel, 14.10.2013.
/// list of places.
- public MapModel(List placeList)
+ public MapWp8Model(List placeList)
{
this.IsReady = false;
this.LoadSpatials(placeList);
@@ -51,85 +54,12 @@ namespace CampusAppWP8.Model.Campusmap
/// Event ShowMapInfo.
public event MapInfos ShowMapInfos = null;
- #endregion
- #region Property
-
- /// Gets or sets a value indicating whether the map is ready or not.
- /// true if this object is ready, false if not.
- public bool IsReady { get; protected set; }
-
- /// Gets or sets the ImageSource of the map.
- /// The image source.
- public string ImageSource { get; set; }
-
- /// Gets or sets the ImageWidth of the map.
- /// The width of the image.
- public double ImageWidth { get; set; }
-
- /// Gets or sets the ImageHeight of the map.
- /// The height of the image.
- public double ImageHeight { get; set; }
-
- /// Gets or sets the ImageOffsetX of the map.
- /// The map image offset x coordinate.
- public double MapImageOffsetX { get; set; }
-
- /// Gets or sets the ImageOffsetY of the map.
- /// The map image offset y coordinate.
- public double MapImageOffsetY { get; set; }
-
- /// Gets or sets the GeoOffsetX of the map.
- /// The geo offset x coordinate.
- public double GeoOffsetX { get; set; }
-
- /// Gets or sets the GeoOffsetY of the map.
- /// The geo offset y coordinate.
- public double GeoOffsetY { get; set; }
-
- /// Gets or sets the Scale (to pixel) of the map.
- /// The scale x coordinate.
- public double ScaleX { get; set; }
-
- /// Gets or sets the Scale (to pixel) of the map.
- /// The scale y coordinate.
- public double ScaleY { get; set; }
-
- /// Gets or sets the reference point.
- /// The reference point.
- public Point RefPoint { get; set; }
-
- /// Gets or sets the spatial of the map.
- /// The spatial.
- public SpsWp8Model Spatial { get; set; }
-
#endregion
#region Methods
#region public
- /// Method calculate the coordinates of ScrollToOffsets point.
- /// Stubbfel, 14.10.2013.
- /// input point.
- /// point (in pixel)
- public Point GetScrollPoint(Point point)
- {
- return this.GetScrollPoint(point.X, point.Y);
- }
-
- /// Method calculate the coordinates of ScrollToOffsets point.
- /// the input-point will be shown in the center.
- /// x - coordinate.
- /// y - coordinate.
- /// point (in pixel)
- public Point GetScrollPoint(double x, double y)
- {
- x = this.RefPoint.X + this.MapImageOffsetX + x;
- y = this.RefPoint.Y + this.MapImageOffsetY - y;
-
- return new Point(x, y);
- }
-
/// Method create in image, which can show at a certain position.
/// Stubbfel, 27.08.2013.
/// the x- coordinate.
@@ -139,7 +69,7 @@ namespace CampusAppWP8.Model.Campusmap
/// image of the pin.
public Image AddPin(double x, double y, MapPinModel.PinType type, List places = null)
{
- Point position = new Point(x, y);
+ MapPoint position = new MapPoint(x, y);
return this.AddPin(position, type, places);
}
@@ -155,7 +85,7 @@ namespace CampusAppWP8.Model.Campusmap
/// image of the pin.
public Image AddPinFromRefPoint(double x, double y, MapPinModel.PinType type, List places = null)
{
- Point position = new Point(this.RefPoint.X + x, this.RefPoint.Y - y);
+ MapPoint position = new MapPoint(this.RefPoint.X + x, this.RefPoint.Y - y);
return this.AddPin(position, type, places);
}
@@ -168,7 +98,7 @@ namespace CampusAppWP8.Model.Campusmap
/// The type.
/// (Optional) list of places.
/// image of the pin.
- public Image AddPinFromRefPoint(Point position, MapPinModel.PinType type, List places = null)
+ public Image AddPinFromRefPoint(MapPoint position, MapPinModel.PinType type, List places = null)
{
return this.AddPinFromRefPoint(position.X, position.Y, type, places);
}
@@ -179,7 +109,7 @@ namespace CampusAppWP8.Model.Campusmap
/// The type.
/// (Optional) list of places.
/// image of the pin.
- public Image AddPin(Point position, MapPinModel.PinType type, List places = null)
+ public Image AddPin(MapPoint position, MapPinModel.PinType type, List places = null)
{
Image pinImg = new Image();
MapPinModel pin = this.CreatePin(type, places, pinImg);
@@ -197,58 +127,6 @@ namespace CampusAppWP8.Model.Campusmap
return pinImg;
}
- /// Convert a coordinates to coordinates which address pixels.
- /// Stubbfel, 27.08.2013.
- /// the x-coordinate.
- /// the y-coordinate.
- /// Point in pixel-size.
- public Point ConverToPixelPoint(double x, double y)
- {
- Point p = new Point { X = this.ScaleX * x, Y = this.ScaleY * y };
- return p;
- }
-
- /// Convert a coordinates to coordinates which address pixels.
- /// Stubbfel, 14.10.2013.
- /// not scaled point.
- /// Point in pixel-size.
- public Point ConverToPixelPoint(Point point)
- {
- return this.ConverToPixelPoint(point.X, point.Y);
- }
-
- /// Convert a coordinates to coordinates which address mapPoint.
- /// Stubbfel, 14.10.2013.
- /// the x-coordinate.
- /// the y-coordinate.
- /// Point in pixel-size.
- public Point ConverToMapPoint(double x, double y)
- {
- return new Point { X = x - this.GeoOffsetX, Y = y - this.GeoOffsetY };
- }
-
- /// Convert a coordinates to coordinates which address mapPoint.
- /// Stubbfel, 14.10.2013.
- /// not scaled point.
- /// Point in pixel-size.
- public Point ConverToMapPoint(Point point)
- {
- return this.ConverToMapPoint(point.X, point.Y);
- }
-
- #endregion
-
- #region protected
-
- /// Loads the spatial object
- /// Stubbfel, 19.08.2013.
- /// list of places.
- protected virtual void LoadSpatials(List placeList)
- {
- this.Spatial = new SpsWp8Model();
- this.Spatial.AddPlaces(placeList);
- }
-
#endregion
#region private
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/ClickAblePlacePinModel.cs
similarity index 89%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/ClickAblePlacePinModel.cs
index d8c245fc..2a314373 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/ClickAblePlacePinModel.cs
@@ -6,10 +6,12 @@
// 14.10.2013
// Implements the click able place pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
+ using CampusAppWP8.Model.Campusmap.Map;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// abstract class for click abel bins.
/// Stubbfel, 14.10.2013.
@@ -20,7 +22,7 @@ namespace CampusAppWP8.Model.Campusmap
/// Gets or sets Callback Function, to show place information of the Pin.
/// The call back.
- public MapModel.MapInfos CallBack { get; set; }
+ public MapWp8Model.MapInfos CallBack { get; set; }
/// Gets or sets place which are associative with this pin.
/// The associated places.
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/CurrentPositionPinModel.cs
similarity index 85%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/CurrentPositionPinModel.cs
index 78d17ad9..7e3d0ed4 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/CurrentPositionPinModel.cs
@@ -6,10 +6,12 @@
// 14.10.2013
// Implements the current position pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using System.Windows;
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Utility;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// Current position pin model.
/// Stubbfel, 27.08.2013.
@@ -25,8 +27,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.CurrentPosition;
this.ImageWidth = 60;
this.ImageHeight = 60;
- this.PinImageOffsetX = -25;
- this.PinImageOffsetY = -34;
+ this.PinImageOffsetPoint = new MapPoint(-25, -34);
this.Tag = MapPinModel.CurrentPositionPlacePinString;
this.ZIndex = 3;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/HiddenPinPlaceModel.cs
similarity index 91%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/HiddenPinPlaceModel.cs
index 57290f3a..cfe0fe7a 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/HiddenPinPlaceModel.cs
@@ -6,7 +6,8 @@
// 14.10.2013
// Implements the hidden pin place model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+using CampusAppWPortalLib8.Model.Campusmap.Pin;
+namespace CampusAppWP8.Model.Campusmap.Pin
{
/// Hidden pin place model.
/// Stubbfel, 27.08.2013.
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoLabPlacePinModel.cs
similarity index 88%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoLabPlacePinModel.cs
index 2d63a436..98f55e55 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoLabPlacePinModel.cs
@@ -6,9 +6,10 @@
// 14.10.2013
// Implements the information lab place pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Utility;
/// Search pin place model.
/// Stubbfel, 27.08.2013.
@@ -24,8 +25,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.PlaceLab;
this.ImageWidth = 40;
this.ImageHeight = 40;
- this.PinImageOffsetX = -20;
- this.PinImageOffsetY = -15;
+ this.PinImageOffsetPoint = new MapPoint(-10, -15);
this.ZIndex += 1;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceAccessPinModel.cs
similarity index 87%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceAccessPinModel.cs
index 0c5e5d2e..63f162db 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceAccessPinModel.cs
@@ -6,9 +6,10 @@
// 14.10.2013
// Implements the information place access pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Utility;
/// Search pin place model.
/// Stubbfel, 27.08.2013.
@@ -24,8 +25,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.PlaceInfoAccess;
this.ImageWidth = 40;
this.ImageHeight = 40;
- this.PinImageOffsetX = -10;
- this.PinImageOffsetY = -35;
+ this.PinImageOffsetPoint = new MapPoint(-10, -15);
}
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlacePinModel.cs
similarity index 85%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlacePinModel.cs
index 1111da33..30b20977 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlacePinModel.cs
@@ -6,9 +6,11 @@
// 14.10.2013
// Implements the information place pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Utility;
/// Search pin place model.
/// Stubbfel, 27.08.2013.
@@ -24,8 +26,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.PlaceInfo;
this.ImageWidth = 60;
this.ImageHeight = 60;
- this.PinImageOffsetX = -25;
- this.PinImageOffsetY = -27;
+ this.PinImageOffsetPoint = new MapPoint(-25, -27);
this.Tag = MapPinModel.PinTypeToString(PinType.InfoPlace);
this.ZIndex = 1;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceRedPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceRedPinModel.cs
similarity index 85%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceRedPinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceRedPinModel.cs
index 4696f932..c18b72b0 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceRedPinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceRedPinModel.cs
@@ -6,9 +6,11 @@
// 14.10.2013
// Implements the information place red pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Utility;
/// A data Model for the information place red pin.
/// Stubbfel, 14.10.2013.
@@ -24,8 +26,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.PlaceRearchRed;
this.ImageWidth = 60;
this.ImageHeight = 60;
- this.PinImageOffsetX = -25;
- this.PinImageOffsetY = -27;
+ this.PinImageOffsetPoint = new MapPoint(-25, -27);
this.ZIndex += 1;
this.Tag = MapPinModel.InfoRedPlacePinString;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceWCPinModel.cs
similarity index 88%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceWCPinModel.cs
index e070250f..77d3d23a 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/InfoPlaceWCPinModel.cs
@@ -6,9 +6,10 @@
// 14.10.2013
// Implements the information place wc pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Utility;
/// Search pin place model.
/// Stubbfel, 27.08.2013.
@@ -24,8 +25,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.PlaceInfoWc;
this.ImageWidth = 40;
this.ImageHeight = 40;
- this.PinImageOffsetX = 0;
- this.PinImageOffsetY = -10;
+ this.PinImageOffsetPoint = new MapPoint(0, -10);
this.ZIndex += 1;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/SearchPlacePinModel.cs
similarity index 85%
rename from CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs
rename to CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/SearchPlacePinModel.cs
index 252be325..a15f8b68 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/Pins/SearchPlacePinModel.cs
@@ -6,9 +6,11 @@
// 14.10.2013
// Implements the search place pin model class
//-----------------------------------------------------------------------
-namespace CampusAppWP8.Model.Campusmap
+namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Utility;
/// Search pin place model.
/// Stubbfel, 27.08.2013.
@@ -26,8 +28,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.SearchPlace;
this.ImageWidth = 60;
this.ImageHeight = 60;
- this.PinImageOffsetX = -25;
- this.PinImageOffsetY = -27;
+ this.PinImageOffsetPoint = new MapPoint(-25, -27);
this.Tag = MapPinModel.SearchPlacePinString;
this.ZIndex = 4;
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
index 92281c60..7a61db9c 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
@@ -8,6 +8,18 @@
//-----------------------------------------------------------------------
namespace CampusAppWP8.Pages.Campusmap
{
+ using CampusAppWP8.File.Places;
+ using CampusAppWP8.Model.Campusmap.Map;
+ using CampusAppWP8.Model.Campusmap.Pin;
+ using CampusAppWP8.Model.GeoDb;
+ using CampusAppWP8.Resources;
+ using CampusAppWP8.Utility;
+ using CampusAppWP8.Utility.Lui.MessageBoxes;
+ using CampusAppWP8.Utility.NDEF;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Utility;
+ using Microsoft.Phone.Controls;
+ using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Device.Location;
@@ -19,15 +31,6 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Navigation;
- using CampusAppWP8.File.Places;
- using CampusAppWP8.Model.Campusmap;
- using CampusAppWP8.Model.GeoDb;
- using CampusAppWP8.Resources;
- using CampusAppWP8.Utility;
- using CampusAppWP8.Utility.Lui.MessageBoxes;
- using CampusAppWP8.Utility.NDEF;
- using Microsoft.Phone.Controls;
- using Microsoft.Phone.Shell;
using Windows.Networking.Proximity;
/// Class for the campusMap page.
@@ -623,7 +626,7 @@ namespace CampusAppWP8.Pages.Campusmap
///
private void AddPin(double x, double y, MapPinModel.PinType type, bool scroll = true, List assocPlaces = null)
{
- Point scrollPoint = this.campusMap.GetScrollPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)));
+ MapPoint scrollPoint = this.campusMap.GetScrollPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)));
MapCanvas.Children.Add(this.campusMap.AddPinFromRefPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)), type, assocPlaces));
MapScroller.UpdateLayout();
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
index a6e3446f..c49774cb 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
@@ -23,6 +23,9 @@ namespace CampusAppWP8.Pages.Campusmap
using CampusAppWP8.Utility.Lui.MessageBoxes;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
+ using CampusAppWP8.Model.Campusmap.Map;
+ using CampusAppWP8.Model.Campusmap.Pin;
+ using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// Class of the RoomListPage.
/// Stubbfel, 14.10.2013.
@@ -43,10 +46,10 @@ namespace CampusAppWP8.Pages.Campusmap
private bool pinchRun = false;
/// The MapPoint.
- private Point mappoint;
+ private MapPoint mappoint;
/// The offset point.
- private Point offsetPoint;
+ private MapPoint offsetPoint;
/// The layer list picker.
private ListPickerItemListModel layerListPicker;
@@ -153,8 +156,9 @@ namespace CampusAppWP8.Pages.Campusmap
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
- Point roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
- Point viewPoint = new Point(roompoint.X - this.mappoint.X + this.offsetPoint.X, roompoint.Y - this.mappoint.Y + this.offsetPoint.Y);
+ MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
+ MapPoint viewPoint = roompoint - mappoint + offsetPoint;
+
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, MapPinModel.PinType.InfoRedPlace, new List { room }));
}
@@ -298,8 +302,8 @@ namespace CampusAppWP8.Pages.Campusmap
{
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
- Point roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
- Point viewPoint = new Point(roompoint.X - this.mappoint.X + this.offsetPoint.X, roompoint.Y - this.mappoint.Y + this.offsetPoint.Y);
+ MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
+ MapPoint viewPoint = roompoint - mappoint + offsetPoint;
MapPinModel.PinType type;
@@ -324,7 +328,7 @@ namespace CampusAppWP8.Pages.Campusmap
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, type, new List { room }));
}
- // MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
+ // MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
}
/// Shows the layer places.
@@ -350,7 +354,7 @@ namespace CampusAppWP8.Pages.Campusmap
double y = this.building.Building.GeoRefPoint.Latitude;
double x = this.building.Building.GeoRefPoint.Longitude;
this.mappoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
- this.offsetPoint = new Point(-this.buildingMap.MapImageOffsetX, -this.buildingMap.MapImageOffsetY);
+ this.offsetPoint = -this.buildingMap.MapImageOffsetPoint;// new Point(-this.buildingMap.MapImageOffsetX, -this.buildingMap.MapImageOffsetY);
this.MapCanvas.DataContext = this.buildingMap;
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
index ab3dd3e0..98f32ee9 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
@@ -528,9 +528,6 @@
/Pages/Campusmap/RoomListPage.xaml
-
- Ebene
-
Barrierefreiheit
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs
index c193b4a1..2da9f39b 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs
@@ -1131,15 +1131,6 @@ namespace CampusAppWP8.Resources {
}
}
- ///
- /// Sucht eine lokalisierte Zeichenfolge, die Ebene ähnelt.
- ///
- public static string PisInformationName_Layer {
- get {
- return ResourceManager.GetString("PisInformationName_Layer", resourceCulture);
- }
- }
-
///
/// Sucht eine lokalisierte Zeichenfolge, die Name ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
index da03d882..87d42f83 100644
--- a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
+++ b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs
@@ -18,28 +18,15 @@ namespace CampusAppWP8.Utility
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Settings;
+ using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Utility;
using Microsoft.Phone.Net.NetworkInformation;
+ using CampusAppWPortalLib8.Model.Campusmap.Map;
/// Collection of utility functions.
/// Stubbfel, 14.10.2013.
public static class Utilities
{
- #region member
-
- /// The north campus of cottbus.
- private static GeoCoordinate northCB = new GeoCoordinate(51.77670359509875,14.293908825617);
-
- /// The middle campus of cottbus.
- private static GeoCoordinate midCB = new GeoCoordinate(51.76737987049448,14.324056352976152);
-
- /// The south campus of cottbus.
- private static GeoCoordinate southCB = new GeoCoordinate(51.72668339740452,14.319497377197282);
-
- /// The middle campus of senftenberg.
- private static GeoCoordinate midSFB = new GeoCoordinate(51.522217168257356,13.986618441187698);
-
- #endregion
#region Enums
/// Comparison types.
@@ -416,16 +403,18 @@ namespace CampusAppWP8.Utility
return result;
}
- Point currentPoint = new Point(log, lat);
-
+ MapPoint currentPoint = new MapPoint(log, lat);
+ MapPoint tmpCampus = CampusMapPoints.NorthCB;
- double minDistance = Utilities.CalcDistance(currentPoint, new Point(Utilities.northCB.Longitude, Utilities.northCB.Latitude));
+ double minDistance = MapPoint.CalcDistance(currentPoint, tmpCampus);
if (minDistance < 0.01)
{
result = Campus.CB_NORTH;
}
- double tmpDistance = Utilities.CalcDistance(currentPoint, new Point(Utilities.midCB.Longitude, Utilities.midCB.Latitude));
+
+ tmpCampus = CampusMapPoints.MidCB;
+ double tmpDistance = MapPoint.CalcDistance(currentPoint, tmpCampus);
if (tmpDistance < 0.01 && tmpDistance < minDistance)
{
@@ -433,16 +422,16 @@ namespace CampusAppWP8.Utility
result = Campus.CB_MAIN;
}
- tmpDistance = Utilities.CalcDistance(currentPoint, new Point(Utilities.southCB.Longitude, Utilities.southCB.Latitude));
-
+ tmpCampus = CampusMapPoints.SouthCB;
+ tmpDistance = MapPoint.CalcDistance(currentPoint, tmpCampus);
if (tmpDistance < 0.01 && tmpDistance < minDistance)
{
minDistance = tmpDistance;
result = Campus.CB_SOUTH;
}
- tmpDistance = Utilities.CalcDistance(currentPoint, new Point(Utilities.midSFB.Longitude, Utilities.midSFB.Latitude));
-
+ tmpCampus = CampusMapPoints.MidSFB;
+ tmpDistance = MapPoint.CalcDistance(currentPoint, tmpCampus);
if (tmpDistance < 0.01 && tmpDistance < minDistance)
{
minDistance = tmpDistance;
@@ -452,19 +441,6 @@ namespace CampusAppWP8.Utility
return result;
}
- /// Calculates the distance.
- /// Stubbfel, 14.10.2013.
- /// the source point.
- /// the destination Point.
- /// The calculated distance.
- public static double CalcDistance(Point src, Point dst)
- {
- double xPow = Math.Pow(dst.X - src.X, 2);
- double yPow = Math.Pow(dst.Y - src.Y, 2);
- double result = Math.Sqrt(xPow + yPow);
- return Math.Sqrt(Math.Pow(dst.X - src.X, 2) + Math.Pow(dst.Y - src.Y, 2));
- }
-
#endregion
}
}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWPortalLib8/CampusAppWPortalLib8.csproj b/CampusAppWP8/CampusAppWPortalLib8/CampusAppWPortalLib8.csproj
index a492bf65..52ea7f04 100644
--- a/CampusAppWP8/CampusAppWPortalLib8/CampusAppWPortalLib8.csproj
+++ b/CampusAppWP8/CampusAppWPortalLib8/CampusAppWPortalLib8.csproj
@@ -33,6 +33,9 @@
4
+
+
+
@@ -80,6 +83,7 @@
+
True
@@ -119,6 +123,7 @@
Designer
+