Exemplo n.º 1
0
 private void DrawLine(PointLatLng latlng)
 {
     //UnityEngine.Debug.Log("draw line " + latlng);
     if (m_currentRoute == null)
     {
         UnityEngine.Debug.Log("create line " + latlng);
         string handleName = MapTools.CreateMapName(MapLayer.Line);
         m_currentPoints.Clear();
         m_currentPoints.Add(latlng);
         m_currentRoute        = new GMapRoute(m_currentPoints, handleName);
         m_currentRoute.Stroke = new Pen(Color.Yellow, 3);
         m_mapLayers[MapLayer.Line].Routes.Add(m_currentRoute);
         if (GameEvent.MapEvent.OnAddRoute != null)
         {
             GameEvent.MapEvent.OnAddRoute(handleName, MapLayer.Line, m_currentRoute);
         }
     }
     else
     {
         m_currentRoute.Points.Add(latlng);
         //m_currentRoute.
         m_map.UpdateRouteLocalPosition(m_currentRoute);
         m_map.Refresh();
     }
 }
Exemplo n.º 2
0
 private void DrawArea(PointLatLng latlng)
 {
     //UnityEngine.Debug.Log("draw line " + latlng);
     if (m_currentPolygon == null)
     {
         UnityEngine.Debug.Log("create area " + latlng);
         string handleName = MapTools.CreateMapName(MapLayer.Area);
         m_currentPoints.Clear();
         m_currentPoints.Add(latlng);
         m_currentPolygon                  = new GMapPolygon(m_currentPoints, handleName);
         m_currentPolygon.Fill             = new Alt.Sketch.SolidColorBrush(Color.FromArgb(50, Color.Red));
         m_currentPolygon.Stroke           = new Pen(Color.Blue, 2);
         m_currentPolygon.IsHitTestVisible = true;
         if (GameEvent.MapEvent.OnAddRoute != null)
         {
             GameEvent.MapEvent.OnAddRoute(handleName, MapLayer.Area, m_currentPolygon);
         }
         m_mapLayers[MapLayer.Area].Polygons.Add(m_currentPolygon);
     }
     else
     {
         m_currentPolygon.Points.Add(latlng);
         m_map.UpdatePolygonLocalPosition(m_currentPolygon);
         m_map.Refresh();
     }
 }