This is a migrated thread and some comments may be shown as answers.

Update 2010 Q1 to 2011 Q1

2 Answers 50 Views
Map
This is a migrated thread and some comments may be shown as answers.
Murat
Top achievements
Rank 1
Murat asked on 23 Mar 2011, 03:34 PM
Hi,
When I updated my project Im getting these errors. 
"no suitable method found to override " for all function.
How can i fix the problem ?

public class YahooProvider : MapProviderBase
    {
        public MapMode Mode = new MapMode();
        public bool LabelVisible;
        public string Language = "en";
        public string VersionYahooMap = "4.3";
        public string VersionYahooSatellite = "1.9";
        public string VersionYahooLabels = "4.3";
 
        public string mapServiceUrl { get; set; }
        public string Token { get; set; }
        public YahooProvider(MapMode mode, bool labelVisible) : base(mode, labelVisible)
        {
            Mode = mode;
            LabelVisible = labelVisible;
            mapServiceUrl = @"map{0}.pergo.com.tr";
        }
 
        public override MapProviderBase GetSource(MapMode mode, bool isLabelVisible)
        {
            return this;
        }
        public override ISpatialReference SpatialReference
        {
            get
            {
                return new MercatorProjection();
            }
 
        }
        public override Size TileSize
        {
            get
            {
                return new Size(base.TileSize.Width, base.TileSize.Height);
            }
        }
        public override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
        {
            int zoomLevel = this.ConvertTileToZoomLevel(tileLevel);
 
            string URL = "";
            if (Mode == MapMode.Road)
                URL = string.Format("http://maps{0}.yimg.com/hx/tl?v={1}&.intl={2}&x={3}&y={4}&z={5}&r=1", ((GetServerNum(tilePositionX, tilePositionY, 2)) + 1), VersionYahooMap, Language, tilePositionX, (((1 << zoomLevel) >> 1) - 1 - tilePositionY), (zoomLevel + 1));
            else if (Mode == MapMode.Aerial)
                URL = string.Format("http://maps{0}.yimg.com/ae/ximg?v={1}&t=a&s=256&.intl={2}&x={3}&y={4}&z={5}&r=1", 3, VersionYahooSatellite, Language, tilePositionX, (((1 << zoomLevel) >> 1) - 1 - tilePositionY), (zoomLevel + 1));
            else
                URL = string.Format("http://maps{0}.yimg.com/hx/tl?v={1}&t=h&.intl={2}&x={3}&y={4}&z={5}&r=1", 1, VersionYahooLabels, Language, tilePositionX, (((1 << zoomLevel) >> 1) - 1 - tilePositionY), (zoomLevel + 1));
            return new Uri(URL);
        }
        internal int GetServerNum(int tilePositionX, int tilePositionY, int max)
        {
            return (tilePositionX + 2 * tilePositionY) % max;
        }
        private bool initialized;
        public override void Initialize()
        {
            this.initialized = this.IsInitialized;
        }
        private System.Collections.Generic.IEnumerable<MapMode> SupportedMode_;
        public override System.Collections.Generic.IEnumerable<MapMode> SupportedModes
        {
            get
            {
                if (SupportedMode_ == null)
                {
                    SupportedMode_ = new Collection<MapMode>();
                }
                return SupportedMode_;
            }
        }
        public override bool IsLabelSupported
        {
            get { return false; }
        }
        public override bool IsModeSupported(MapMode mode)
        {
            return true;
        }
        public override int MaxZoomLevel
        {
            get
            {
                return base.MaxZoomLevel;
            }
            set
            {
                base.MaxZoomLevel = value;
            }
        }
        public override int MinZoomLevel
        {
            get
            {
                return base.MinZoomLevel;
            }
            set
            {
                base.MinZoomLevel = value;
            }
        }
        protected override bool IsValidTileLevel(int tileLevel)
        {
            return base.IsValidTileLevel(tileLevel);
        }
        protected override void OnMapModeChanged(MapMode oldMode, MapMode newMode)
        {
 
        }
        public override LocationRect CoordinateBounds
        {
            get
            {
                return base.CoordinateBounds;
            }
        }
    }

2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 25 Mar 2011, 06:30 PM
Hello Murat,

The custom map provider architecture is not backwards compatible with previous versions. For more information about changes of the Q1 2011, please, take a look to the release history:
http://www.telerik.com/products/silverlight/whats-new/release-history/q1-2011-version-2011-1-0315.aspx

Please see the following topic of RadMap: "Custom map provider architecture is not backwards compatible with previous versions".

Also you can look at the "How to implement custom map provider" documentation topic:
http://www.telerik.com/help/silverlight/radmap-howto-custom-provider.html

I have attached a sample solution with your custom provider. I have updated it according to new architecture.


Regards,
Andrey Murzov
the Telerik team
0
Murat
Top achievements
Rank 1
answered on 30 Mar 2011, 10:57 AM
Examples solved my problem.

Thanks.
Tags
Map
Asked by
Murat
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Murat
Top achievements
Rank 1
Share this question
or