Skip To Content ArcGIS for Developers Sign In Dashboard

OpenStreetMap layer

Open street map layer


// Copyright 2019 Esri.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using Foundation;
using UIKit;

namespace ArcGISRuntimeXamarin.Samples.OpenStreetMapLayer
        "OpenStreetMap layer",
        "Display an OpenStreetMap layer as a basemap.",
    public class OpenStreetMapLayer : UIViewController
        // Hold references to UI controls.
        private MapView _myMapView;

        public OpenStreetMapLayer()
            Title = "OpenStreetMap layer";

        private void Initialize()
            // Create the OpenStreetMap basemap.
            Basemap osmBasemap = Basemap.CreateOpenStreetMap();

            // Create the map with the OpenStreetMap basemap.
            Map osmMap = new Map(osmBasemap);

            // Show the map in the view.
            _myMapView.Map = osmMap;

        public override void LoadView()
            // Create the views.
            View = new UIView();
            _myMapView = new MapView();
            _myMapView.TranslatesAutoresizingMaskIntoConstraints = false;

            // Add the views.

            // Lay out the views.

        public override void ViewDidLoad()

In this topic
  1. Code