Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.testsettings
*.log
*.appxupload
*.appx
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
SDK/
nuget/*/content
nuget/*/lib
[Rr]elease*/
obj/*
bin/*
2 changes: 2 additions & 0 deletions MapManager_Metro/High Level/IMapMarkerSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ public interface IMapMarkerSource
{
IAnnotationMarker MarkerForAnnotation(IMapAnnotation annotation);

bool ShowCalloutForAnnotation(IMapAnnotation annotation);

}
}
34 changes: 32 additions & 2 deletions MapManager_Metro/High Level/MapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public class MapManager : IAnnotationManagerFeedback, IMapMarkerSource
{
// Public members
public IMapMarkerSource markerSource;

// Events
public event EventHandler<CalloutButtonTappedEventArgs> Callout_ButtonTapped;
public event EventHandler<AnnotationTappedEventArgs> Annotation_Tapped;

// Private Members
private Map map;
Expand Down Expand Up @@ -97,8 +99,23 @@ public IAnnotationMarker MarkerForAnnotation(IMapAnnotation annotation)
return new DefaultMapMarker();

}

public bool ShowCalloutForAnnotation(IMapAnnotation annotation)
{
// Calls back to our own delegate if it exists)
if (markerSource != null)
return markerSource.ShowCalloutForAnnotation(annotation);
else
return true;

}

public void MapAnnotationClicked(IMapAnnotation annotation)
{
if (this.Annotation_Tapped != null) {
this.Annotation_Tapped(this, new AnnotationTappedEventArgs(annotation));
}

displayCalloutForAnnotation(annotation);
}
#endregion
Expand All @@ -108,9 +125,11 @@ public void MapAnnotationClicked(IMapAnnotation annotation)
#region Callouts
void displayCalloutForAnnotation(IMapAnnotation annotation)
{
IAnnotationMarker annotationElement = (IAnnotationMarker)annotationManager.UIElementForAnnotation(annotation);
if(this.ShowCalloutForAnnotation(annotation)) {
IAnnotationMarker annotationElement = (IAnnotationMarker)annotationManager.UIElementForAnnotation(annotation);

calloutManager.displayCallout(annotation, annotationElement);
calloutManager.displayCallout(annotation, annotationElement);
}
}
void calloutManager_Callout_ButtonTapped(object sender, CalloutButtonTappedEventArgs e)
{
Expand All @@ -137,4 +156,15 @@ public void removeAllPolylines()


}


public class AnnotationTappedEventArgs : EventArgs
{
public IMapAnnotation Annotation { get; set; }

public AnnotationTappedEventArgs( IMapAnnotation annotation)
{
this.Annotation = annotation;
}
}
}
Binary file removed MapManager_Metro/bin/x86/Debug/Bing.Maps.winmd
Binary file not shown.
Loading