title | page_title | description | slug | tags | published | position |
---|---|---|---|---|---|---|
Wraparound |
Wraparound |
Check our "Wraparound" documentation article for the RadMap {{ site.framework_name }} control. |
radmap-features-wraparound |
wraparound, continuous, panning, horizontal, infinite |
true |
17 |
The WrapAround feature provides infinite horizontal panning to the RadMap control which gives continuous experience as the user pans the viewport east or west.
The feature is not enabled by default. To turn it on you can set the WrapAround property of the RadMap to True.
{{region xaml-radmap-features-wraparound-01}} <telerik:RadMap WrapAround="True"> telerik:RadMap.Provider <telerik:OpenStreetMapProvider /> </telerik:RadMap.Provider> </telerik:RadMap> {{endregion}}
When the wraparound is enabled, the longitude of the map's viewport can exceed the valid geographical boundaries (from -180 to 180 degrees in the default Mercator projection) when you pan the viewport. The Location Conversion section of this article explains how to convert shifted locations to valid geographical boundaries (-180 to 180).
Services like Geocode, Search, Routing use Longitude within the valid geographical boundaries.
RadMap exposes two methods which you can use to convert map coordinates.
-
GetShiftedLocation(Location standardLocation)
This method accepts a location in the standard longitude range of the Mercator projection ( from -180 to 180 degrees), and returns a shifted location based on the shift of the map's center when panned outside of the standard longitude range.
{{region radmap-features-wraparound-02}} Location shiftedLocation = this.myRadMap.GetShiftedLocation(standardLocation); {{endregion}}
-
GetCoercedLocation(Location shiftedLocation)
This method accepts shifted coordinates and returns a Location object by converting shifted location's to standard location in the range from -180 to 180 degrees.
{{region radmap-features-wraparound-03}} Location desiredLocation = this.myRadMap.GetCoercedLocation(shiftedLocation); {{endregion}}
When the wraparound feature is enabled on the RadMap the built-in MiniMap also has this functionality turned on. But when you are using the MiniMap as a standalone control you have to explicitly set its WrapAround property to True in order to turn the feature on.
The WrapAround property of the RadMap control that is linked to the MiniMap has a higher priority than the WrapAround property of the MiniMap.
The wraparound feature is supported by the following providers.
-
BingRestMapProvider
-
OpenStreetMapProvider
-
ArcGisMapProvider
- [Getting Started] ({%slug radmap-getting-started%})
- [MiniMap] ({%slug radmap-features-mini-map%})
- [Wraparound with Virtualization in VisualizationLayer] ({%slug radmap-howto-wraparound-virtualization-visualizationlayer%})
- [BingRestMapProvider]({%slug radmap-features-providers-bing-rest-map%})