Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OsmSharp.Android.UI.MapLayout"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="surface">Surface.</param>
        public MapView(Context context, IMapViewSurface surface)
            : base(context)
        {
            _mapView = surface;
            _mapView.Initialize(this);
            _markers = new List<MapMarker> ();

            this.Initialize ();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OsmSharp.Android.UI.MapLayout"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="surface">Surface.</param>
        public MapView(Context context, IMapViewSurface surface)
            : base(context)
        {
            _mapView = surface;
            _mapView.Initialize(this);
            _markers = new List <MapMarker> ();

            this.Initialize();
        }
Ejemplo n.º 3
0
        private MapView(Context context, IMapViewSurface surface, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
            //It's possible to avoid this copy+paste by making this the sole constructor and
            //having MapView(Context,Surface) defer to this code, provided that we create a stub attribute set.
            //However this would be contrary to the frameworks design intent and methods for doing
            //so are not documented; doing so will invoke undefined behavior.

            _mapView = surface;
            _mapView.Initialize(this);
            _markers  = new List <MapMarker>();
            _controls = new List <MapControl>();

            this.Initialize();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Diposes of all resources associated with this object.
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (disposing == true)
            {
                //someone want the deterministic release of all resources
                //Let us release all the managed resources
            }
            else
            {
                // Do nothing, no one asked a dispose, the object went out of
                // scope and finalized is called so lets next round of GC
                // release these resources
            }

            // Release the unmanaged resource in any case as they will not be
            // released by GC
            if (this._mapView != null)
            { // dispose of the map view surface.
                this._mapView.Dispose();
                this._mapView = null;
            }
        }
Ejemplo n.º 5
0
        private MapView(Context context, IMapViewSurface surface, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
            //It's possible to avoid this copy+paste by making this the sole constructor and
            //having MapView(Context,Surface) defer to this code, provided that we create a stub attribute set.
            //However this would be contrary to the frameworks design intent and methods for doing
            //so are not documented; doing so will invoke undefined behavior.

            _mapView = surface;
            _mapView.Initialize(this);
            _markers = new List<MapMarker>();
            _controls = new List<MapControl>();

            this.Initialize();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Diposes of all resources associated with this object.
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (disposing == true)
            {
                //someone want the deterministic release of all resources
                //Let us release all the managed resources
            }
            else
            {
                // Do nothing, no one asked a dispose, the object went out of
                // scope and finalized is called so lets next round of GC 
                // release these resources
            }

            // Release the unmanaged resource in any case as they will not be 
            // released by GC
            if (this._mapView != null)
            { // dispose of the map view surface.
                this._mapView.Dispose();
                this._mapView = null;
            }
        }