Exemple #1
0
        internal void MoveMarker(int?index, double latitude, double longitude, double?altitude)
        {
            if (!IsEditable)
            {
                return;
            }

            Log.Debug($"MoveMarker: {index?.ToString() ?? "<null>"}, {latitude}, {longitude}, {altitude}");

            MapMarkerModel marker;

            if (index == null)
            {
                Markers.Add(marker = new MapMarkerModel()
                {
                    IsEditable = true
                });
            }
            else
            {
                marker = Markers[index.Value];
            }

            if (marker.IsEditable)
            {
                marker.Latitude  = latitude;
                marker.Longitude = longitude;
                marker.Altitude  = altitude;
                MarkersChanged?.Invoke();
            }
        }