What’s New in 2018 Volume 3: Xamarin.Forms Maps | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (919)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (150)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Xamarin.Forms Maps what's new tile image

What’s New in 2018 Volume 3: Xamarin.Forms Maps Updates

We are excited to announce updates for our popular Xamarin maps control in the 2018 Volume 3 release. This release, we have mainly focused on adding usability-related features and improving product stability. In this blog, we are going to walk you through the following important Xamarin.Forms maps features one by one:

  • Access to imagery layer’s tile images from the application cache to improve performance.
  • Color mapping support for bubbles.
  • Sublayers support.
  • Smart data label alignment support

Access to imagery layer’s tile images from application cache

One of the most important features in the Xamarin maps control is  built-in online map provider support. Using this feature, you can render OpenStreetMap, Bing maps, or maps from other providers. Maps control uses the imagery layer to display tile images from the map provider service. When loading and zooming maps, we have to access the map’s tile images every time from an online service, which causes some performance delay. To overcome this problem, we have provided an option to cache downloaded tile images in an application cache memory. With this support, we can avoid accessing tile images from online services every time and improve performance while loading and zooming maps.

Maps caching support for OSM/Bing maps

If you want to clear existing cached tile images in the application memory, you can invoke the following method.

imageryLayer.DeleteTilesFromCache();

Color mapping support for maps bubbles

Color mapping support is used to categorize bubbles by customizing their color based on the underlying data values. Colors can be applied to bubbles by comparing their values with desired numeric ranges. For example, colors can be applied to countries based on their population density. The following code shows the top 30 countries by world population percentage by applying range color mapping in bubbles.

<maps:ShapeFileLayer.BubbleMarkerSettings>

     <maps:BubbleMarkerSetting  ValuePath="Percent" ColorValuePath="Percent" >

          <maps:BubbleMarkerSetting.ColorMappings>

               <maps:RangeColorMapping Color="#2E769F" From="4" To="20" LegendLabel="Above 4%" />

               <maps:RangeColorMapping Color="#D84444" To="4" From="2" LegendLabel="4% - 2%"  />

               <maps:RangeColorMapping Color="#816F28" To="2" From="1" LegendLabel="2% - 1% "  />

               <maps:RangeColorMapping Color="#7F38A0" To="1" From="0" LegendLabel="Below 1%"  />

          </maps:BubbleMarkerSetting.ColorMappings>

    </maps:BubbleMarkerSetting>

</maps:ShapeFileLayer.BubbleMarkerSettings>

Maps color mapping support

Sublayers

Sublayers is one of the most requested features from our customers. It allows users to load multiple shape files in a single map view. For example, you can add a sublayer over a main shape layer to view the geographic features of a country such as rivers, valleys, and cities in maps.

<maps:ShapeFileLayer.Sublayers>

     <maps:ShapeFileLayer Uri="Texas.shp">

          <maps:ShapeFileLayer.ShapeSettings>

               <maps:ShapeSetting ShapeFill="#B1D8F5" ShapeStroke="#8DCCF4" ShapeStrokeThickness="1" />

          </maps:ShapeFileLayer.ShapeSettings>

          <maps:ShapeFileLayer.Markers>

               <maps:MapMarker Latitude="30.267153" Longitude="-97.7430608"/>

         </maps:ShapeFileLayer.Markers>

     </maps:ShapeFileLayer>

     <maps:ShapeFileLayer x:Name="subLayer1" Uri="California.shp">

           <maps:ShapeFileLayer.ShapeSettings>

                <maps:ShapeSetting ShapeFill="#B1D8F5" ShapeStroke="#8DCCF4" ShapeStrokeThickness="1" />

           </maps:ShapeFileLayer.ShapeSettings>

           <maps:ShapeFileLayer.Markers>

                <maps:MapMarker Latitude="37.3382082" Longitude="-121.8863286"/>

           </maps:ShapeFileLayer.Markers>

      </maps:ShapeFileLayer>

</maps:ShapeFileLayer.Sublayers>

Maps sublayer

Smart label alignment

Map shapes can be easily annotated with data labels to improve the readability of shapes’ names. Sometimes, labels may overlap with other labels or other shapes if the label length is too long. For example, in the following image, due to label collision, state names are not clearly readable.

Maps label collisionTo overcome this problem, we have provided two options to trim or hide the labels that are either overflowing the shape boundaries or overlapping with each other.

Trim or hide overflowing labels

Just by setting the SmartLabelMode property to either Hide or Trim, you can avoid overflowing labels.

Maps label smart mode as trim
SmartLabelMode=”Trim”

Maps labels smart mode as hide
SmartLabelMode=”Hide”

Trim or hide overlapping labels

By using the IntersectionAction property, you can trim or hide the overlapping labels.

Maps label over lapping action as trim
IntersectionAction=”Trim”

Maps label overlapping action as hide
IntersectionAction=”Hide”

The following code shows how to set SmartLabelMode and IntersectionAction.

<maps:ShapeFileLayer.DataLabelSettings>

     <maps:DataLabelSetting  SmartLabelMode="None" IntersectionAction="Hide"/>

</maps:ShapeFileLayer.DataLabelSettings>

And more

Other than this feature set, we have a few more improvements: adding images to marker icons, legend customization, rendering corresponding shape layers from a layers collection by setting BaseMapIndex, exposed events for ZoomLevelChanging, ShapeSelectionChanged, and stability improvement.

We hope that you will enjoy these new features in maps. Check the full release notes for more details, browse complete example code in GitHub, and definitely explore the maps samples available on Google Play and the Microsoft Store.

If you are an existing customer, please download the new version from the License and Downloads page and try the new features for yourself. If you are a new customer, you can try our 30-day free trial to check out these features.

If you have any questions or require clarification, let us know in the comments section. You can also contact us through our support forum or Direct-Trac.

 

Want to learn more? Check out these other posts and free resources:

Tags:

Share this post:

Comments (2)

[…] What’s New in 2018 Volume 3: Xamarin.Forms Maps Updates (Sheik Syed) […]

[…] What’s New in 2018 Volume 3: Xamarin.Forms Maps Updates (Sheik Syed) […]

Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed