public void placepoint(PointLatLng point) { MapObject mapObject_point = new Location_c(OName.Text, "Location", point); mapObjects.Add(mapObject_point); Map.Markers.Add(mapObject_point.GetMarker()); OList.Items.Add(mapObjects.Last().objectType + " - " + mapObjects.Last().objectName); createra.IsEnabled = false; }
public void placepoint(PointLatLng point) { MapObject mapObject_point = new Location_c(OName.Text, "Location", point); mapObjects.Add(mapObject_point); Map.Markers.Add(mapObject_point.GetMarker()); OList.Items.Add(mapObjects.Last().objectType + " - " + mapObjects.Last().objectName); createra.IsEnabled = false; mloc += 1; if (mloc > 1 && mcar > 0 && mhuman > 0) { ChooseH.IsEnabled = true; ChooseD.IsEnabled = true; } }
private void createMarker(List <PointLatLng> points, int index) { MapObject mapObject = null; switch (index) { case 4: { if (points.Count < 3) { MessageBox.Show("Выберите точки"); return; } mapObject = new Area(OName.Text, points); break; } case 0: { if (points.Count < 1) { MessageBox.Show("Выберите точки"); return; } mapObject = new Location_c(OName.Text, points.Last()); break; } case 1: { if (points.Count < 1) { MessageBox.Show("Выберите точки"); return; } mapObject = new Car(OName.Text, points.Last()); break; } case 2: { if (points.Count < 1) { MessageBox.Show("Выберите точки"); return; } mapObject = new Human(OName.Text, points.Last()); break; } case 3: { if (points.Count < 2) { MessageBox.Show("Выберите точки"); return; } mapObject = new Route_c(OName.Text, points); break; } } if (mapObject != null) { mapObjects.Add(mapObject); Map.Markers.Add(mapObject.GetMarker()); } }