Beispiel #1
0
		public Map (POIs selectedPOI, Int32 _idCategory)
		{
			this.isGeneralMap = false;
			this.drCurrent = selectedPOI;
			this.idCategory = _idCategory;
			this.mapPOIs = new List<POIs> ();
			this.isFirstLoading = true;


			var currentPlatform = DependencyService.Get<platformSpecific> ();
			foreach (POIs p in Global.K_POIs.Where(x=>x.IDLanguage==Global.currentLanguage).ToList()) {
				Double myDistance = currentPlatform.GetDistance (Convert.ToDouble (drCurrent.Latitude), Convert.ToDouble (drCurrent.Longitude), 
					                    Convert.ToDouble (p.Latitude), Convert.ToDouble (p.Longitude));
				if (myDistance <= Global.MaxDistanceMeters) {
					this.mapPOIs.Add (p);
				}
			}
			myLoad ();
		}
Beispiel #2
0
		private void bindMap (Int32 catID, POIs drCurrent)
		{
			mypins.Clear ();
			//add current poi
			foreach (POIs myPoi in this.mapPOIs) {
				var currentPlatform = DependencyService.Get<platformSpecific> ();
				var path = Path.Combine (currentPlatform.getLocalDatabasePath (), "C");
				//Categories c = Global.K_Categories.First (x => x.IDCategory == this.idCategory);
				List<Categories_POIs> cp = Global.K_Categories_POIs.Where (x => x.IDPOI == myPoi.IDPOI).ToList ();
				Categories c = Global.K_Categories.First (x => x.IDCategory == cp [0].IDCategory); //take the first category
				path = Path.Combine (path, c.Icon3);
				c.MapImageFullPath = path;
				if (this.mapCategories.Contains (c) == false)
					this.mapCategories.Add (c);
				Boolean lAdd = false;
				if (catID == 0)
					lAdd = true;
				else {
					if (c.IDCategory != catID)
						lAdd = false;
					else
						lAdd = true;
				}
				if (drCurrent != null && myPoi.IDPOI == drCurrent.IDPOI) {
					lAdd = true;
					//always add current poi apart from general map
				}
				if (lAdd == false)
					continue;	
				mypins.Add (new ExtendedPin () {
					Name = myPoi.NameOfThePOI,
					Location = new Location () {
						Latitude = Convert.ToDouble (myPoi.Latitude.Value),
						Longitude = Convert.ToDouble (myPoi.Longitude.Value)
					},
					Details = "",
					ImageUrl = path
				});
			}
			map.UpdatePins (mypins);
		}