Important question from potential customer

2 posts, 0 answers
  1. Wojcik
    Wojcik avatar
    1 posts
    Member since:
    Apr 2011

    Posted 07 Apr 2011 Link to this post

    Hello. Can somebody help me with one important question? Can Telerik's RadMap work into corporation INTRANET without any connection to the internet? In my big network, I have intranet www server, which serves png files like openstreetmap, structure file tiles map is: http://192.168.100.10/{0}/{1}/{2}.png where {0} and {1} and {2} variables are like in OpenStreetMap structure

    http://tile.openstreetmap.org/{0}/{1}/{2}.png  
    At this moment for testing I'm using simple free MapControl library which displays maps very well. But I need something more functional (best product) like Telerik's RadMap.

    I must know, can it works in intranet... if it will work maybe my company buy this product.

    Can somebody from technician help me

    Thak you very much.

    Sorry for my simple (bad) english grammar. :-)

    Wojcik

  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 07 Apr 2011 Link to this post

    Hi Wojcik,

    Yes, you can use the RadMap control to show INTRANET version of openstreetmap tiles.
    Note, that features like Search, Route and Geocode require internet connection, because they use the Bing Maps services.

    You can create custom map tile source and map provider which will uses images from your intranet site. You can use the following sample code to do it:
    /// <summary> 
    /// Tile source which read map tiles from the file system. 
    /// </summary> 
    public class LocalhostTileSource : TiledMapSource 
        private string tileUriFormat; 
        
        /// <summary> 
        /// Initializes a new instance of the FileSystemTileSource class. 
        /// </summary> 
        /// <param name="tileUriFormat">Format string to access tiles on the localhost.</param> 
        public LocalhostTileSource(string tileUriFormat) 
            : base(1, 20, 256, 256) 
        
            this.tileUriFormat = tileUriFormat; 
        
        
        /// <summary> 
        /// Initialize provider. 
        /// </summary> 
        public override void Initialize() 
        
            // Raise provider intialized event. 
            this.RaiseIntializeCompleted(); 
        
        
        /// <summary> 
        /// Gets the image URI. 
        /// </summary> 
        /// <param name="tileLevel">Tile level.</param> 
        /// <param name="tilePositionX">Tile X.</param> 
        /// <param name="tilePositionY">Tile Y.</param> 
        /// <returns>URI of image.</returns> 
        protected override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY) 
        
            int zoomLevel = ConvertTileToZoomLevel(tileLevel); 
        
            string url = this.tileUriFormat.Replace("{zoom}", zoomLevel.ToString(CultureInfo.InvariantCulture)); 
            url = url.Replace("{x}", tilePositionX.ToString(CultureInfo.InvariantCulture)); 
            url = url.Replace("{y}", tilePositionY.ToString(CultureInfo.InvariantCulture)); 
        
            return new Uri(url); 
        
    }

    /// <summary> 
    /// Map provider which read map tiles from the file system. 
    /// </summary> 
    public class LocalhostProvider : TiledProvider 
        /// <summary> 
        /// Initializes a new instance of the LocalhostProvider class. 
        /// </summary> 
        /// <param name="tileUriFormat">Format string to access tiles on the localhost.</param> 
        public LocalhostProvider(string tileUriFormat) 
            : base() 
        
            LocalhostTileSource source = new LocalhostTileSource(tileUriFormat); 
            this.MapSources.Add(source.UniqueId, source); 
        
        
        /// <summary> 
        /// Returns the SpatialReference for the map provider. 
        /// </summary> 
        public override ISpatialReference SpatialReference 
        
            get
            
                return new MercatorProjection(); 
            
        
    }

    <UserControl x:Class="LocalhostMapProvider.MainPage"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 mc:Ignorable="d"
                 d:DesignHeight="300" d:DesignWidth="400"
        
        <Grid x:Name="LayoutRoot" Background="White"
            <telerik:RadMap x:Name="radMap" 
                            Center="48.95,2.3"
                            ZoomLevel="13"
            </telerik:RadMap
        </Grid
    </UserControl

    public partial class MainPage : UserControl 
        public MainPage() 
        
            InitializeComponent(); 
            this.radMap.Provider = new LocalhostProvider( 
                "http://192.168.100.10/{zoom}/{x}/{y}.png"); 
        

    Hope this helps.


    Kind regards,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top