Exemple #1
0
        public TiledMaps()
        {
            InitializeComponent();

            mySession.RefreshBitmap = myRenderer.LoadBitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("WMTiledMapsTestHarness.Refresh.png"));
            IMapDrawable marker = myRenderer.LoadBitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("WMTiledMapsTestHarness.Marker.png"));
            MapOverlay overlay = new MapOverlay(marker, new Geocode(47.6141229683726, -122.346501168284), new Point(0, -marker.Height / 2));
            mySession.Overlays.Add(overlay);
            RefreshBitmap();
        }
 private void SetMarkers()
 {
     float fSize = 9;
     List<string> seenLocs = new List<string>();
     List<Geocode> codes = new List<Geocode>();
     SizeF currentScreen = this.CurrentAutoScaleDimensions;
     if (currentScreen.Height == 192)
     {
         fSize = 4;
     }
     foreach (Library.User user in _Users)
     {
         string location = user.location;
         if (!seenLocs.Contains(location))
         {
             seenLocs.Add(location);
             Yedda.GoogleGeocoder.Coordinate c;
             if (!Yedda.GoogleGeocoder.Coordinate.tryParse(location, out c))
             {
                 c = Yedda.GoogleGeocoder.Geocode.GetCoordinates(location);
             }
             if (c.Latitude != 0 && c.Longitude != 0)
             {
                 userMapDrawable marker = new userMapDrawable();
                 marker.userToDraw = user;
                 marker.fSize = fSize;
                 Geocode g = new Geocode((double)c.Latitude, (double)c.Longitude);
                 MapOverlay o = new MapOverlay(marker, g, new Point(0, -marker.Height / 2));
                 codes.Add(g);
                 mySession.Overlays.Add(o);
             }
         }
     }
     mySession.FitPOIToDimensions(myPictureBox.Width, myPictureBox.Height, 8, codes.ToArray());
 }