Aimee Jones
Aimee Jones

Reputation: 911

Adding custom pins to bing map in Windows Store app

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!

Upvotes: 0

Views: 2447

Answers (2)

Aimee Jones
Aimee Jones

Reputation: 911

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;

Upvotes: 0

Mike Boula
Mike Boula

Reputation: 276

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

Upvotes: 1

Related Questions