예제 #1
0
        private Marker AddTowEventMarkerToMap(TowEvent towEvent)
        {
            if (towEvent.Location != null) {
                var loc = new LatLng (towEvent.Location.Lat, towEvent.Location.Lng);
                MarkerOptions marker = new MarkerOptions ();
                marker.SetPosition (loc);
                marker.SetTitle (string.Format ("Device: {0}", towEvent.MojioId));
                marker.SetSnippet (string.Format ("Date: {0}", towEvent.Time));
                MyLogger.Information (this.LocalClassName, string.Format ("Event Marker Added: {0} at {1}", towEvent.MojioId, loc.ToString ()));
                return AddMarkerToMap (marker);
            }

            return null;
        }
예제 #2
0
        private Marker AddDeviceMarkerToMap(Device dev)
        {
            var loc = new LatLng (dev.LastLocation.Lat, dev.LastLocation.Lng);
            MarkerOptions marker = new MarkerOptions ();
            marker.InvokeIcon (BitmapDescriptorFactory.DefaultMarker (BitmapDescriptorFactory.HueGreen));
            marker.SetPosition (loc);
            String location;
            location = GetAddress (loc.Latitude, loc.Longitude);
            if (location == null)
                location = loc.Latitude.ToString() + ", " + loc.Longitude.ToString();
            marker.SetSnippet (location);
            marker.SetTitle (dev.Name);

            MyLogger.Information (this.LocalClassName, string.Format ("Device Marker Added: {0} at {1}", dev.Name, loc.ToString ()));
            return AddMarkerToMap (marker);
        }