0

I'm new to C# and am working on a Windows Store App that lets a user tap locations on a map to place a marker, save a title and a description for that location. I found the overlayItem class for Android is similar to what I need for my app as it includes a Geopoint and 2 Strings for each overlayItem. I have searched for C# examples to use in my app already but end up going in circles, so I was just wondering if there is a class out there already that may be suitable, or whether it would be better to make my own?
I was thinking something along the lines of this and to make my own get and set methods:

class windowsOverlayItem{
Location loc;
String title;
String description;
Pushpin pin;
}

I've found a few map examples but none that really go to any depth. Any help would be great! Thanks in advance!

Aimee Jones
  • 881
  • 2
  • 18
  • 38

2 Answers2

1

The Bing Maps C# Pushpin Sample implements exactly that. Take a look at its code for more details.

Mike Boula
  • 276
  • 1
  • 4
  • Thanks for your answer Mike. That pushpin sample was the one I was going by mostly. So far my app places a pushpin in my current location and when I tap it, a dialog box shows "you are here". I can also click anywhere on the map and more markers will be placed in these locations. What I'm really stuck on is the best way to click a location, have some sort of text input box for the user to enter details about that location and place a pushpin, so that when the pushpin clicked again it will display the details entered previously. I can post the main part of my code if that would help? – Aimee Jones Oct 16 '12 at 12:03
0

I finally figured out, that tag and name can be used for the info I need to save for each pushpin along with the location. Here's a short example of when I want to add a new Pushpin to my map and save some details to it.

MyMap.Children.Add(newpin);
MapLayer.SetPosition(newpin, loc);
newpin.Name = title;
newpin.Tag = newpin.Tag as String;
newpin.Tag = description;
Aimee Jones
  • 881
  • 2
  • 18
  • 38