<commit_before>﻿using Mapsui.Geometries;
using Mapsui.Projection;
using Mapsui.Utilities;

namespace Mapsui.Samples.Common.Maps
{
    public static class CenterOnLocationSample
    {
        public static Map CreateMap()
        {
            var map = new Map();
            map.Layers.Add(OpenStreetMap.CreateTileLayer());

            // Get the lon lat coordinates from somewhere (Mapsui can not help you there)
            var centerOfLondonOntario = new Point(-81.2497, 42.9837);
            // OSM uses spherical mercator coordinates. So transform the lon lat coordinates to spherical mercator
            var sphericalMercatorCoordinate = SphericalMercator.FromLonLat(centerOfLondonOntario.X, centerOfLondonOntario.Y);
            // Set the center of the viewport to the coordinate. The UI will refresh automatically
            map.Viewport.Center = sphericalMercatorCoordinate;
            // Additionally you might want to set the resolution, this could depend on your specific purpose
            map.Viewport.Resolution = map.Resolutions[9];

            return map;
        }
    }
}<commit_msg>Updated sample in response to #217<commit_after>﻿using Mapsui.Geometries;
using Mapsui.Projection;
using Mapsui.Utilities;

namespace Mapsui.Samples.Common.Maps
{
    public static class CenterOnLocationSample
    {
        public static Map CreateMap()
        {
            var map = new Map();
            map.Layers.Add(OpenStreetMap.CreateTileLayer());

            // Get the lon lat coordinates from somewhere (Mapsui can not help you there)
            var centerOfLondonOntario = new Point(-81.2497, 42.9837);
            // OSM uses spherical mercator coordinates. So transform the lon lat coordinates to spherical mercator
            var sphericalMercatorCoordinate = SphericalMercator.FromLonLat(centerOfLondonOntario.X, centerOfLondonOntario.Y);
            // Set the center of the viewport to the coordinate. The UI will refresh automatically
            map.NavigateTo(sphericalMercatorCoordinate);
            // Additionally you might want to set the resolution, this could depend on your specific purpose
            map.NavigateTo(map.Resolutions[9]);
            
            return map;
        }
    }
}
{'fraction_non_alphanumeric': 0.06660706303084488, 'fraction_numerical': 0.012963790791238265, 'mean_word_length': 2.5750798722044728, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6985496', 'n_tokens_mistral': 614, 'n_tokens_neox': 569, 'n_words': 187}