コード例 #1
0
        /// <summary>
        /// Handle the event of the longpress on the MapView.
        /// MapView에서 longpress의 이벤트를 처리합니다.
        /// </summary>
        /// <param name="sender">Specifies the sender object</param>
        /// <param name="e">Specifies the occured event</param>
        private void MapViewLongPressed(object sender, MapGestureEventArgs e)
        {
            // Set the zoom level
            if (s_mapview.ZoomLevel < 13)
            {
                s_mapview.ZoomLevel = 13;
            }

            // Check the viewpage
            if (view == ViewPage.MAP)
            {
                // Remove the used data
                ClearData();
                // Move to the longpressed position
                // longpressed 지점을 이동합니다.
                s_mapview.Center = e.Geocoordinates;
                // Add the pin to the center positon of the map view
                // map view 중앙 지점에 핀을 추가합니다.
                s_mapview.Add(new Pin(s_mapview.Center));
                // Request the address by the center position of the map view and display the address to the label of the starting position
                // map view의 중앙의 주소를 요청하고 시작 위치의 label에 주소를 표시합니다.
                RequestAddress(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
            }
            else if (view == ViewPage.ROUTE)
            {
                if (fromPosition != null && toPosition != null)
                {
                    // Remove the used data
                    ClearData();
                }

                // Move to the longpressed position
                s_mapview.Center = e.Geocoordinates;

                // Check the text of the from the label
                // label의 텍스트를 확인합니다.
                // null이면
                if (fromPosition == null)
                {
                    // Add a marker to the center position
                    // 중앙에 마커를 추가합니다.
                    s_mapview.Add(new Pin(s_mapview.Center));
                    // Create the Geocoordinates from the center position
                    // 중앙에서 Geocoordinates를 생성합니다.
                    fromPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                }
                // null이 아니면
                else
                {
                    // Add a marker to the center position
                    s_mapview.Add(new Sticker(s_mapview.Center));
                    // Create the Geocoordinates from the center position
                    toPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                    // Request a route with the fromPosition and the toPosition
                    // 출발지점과 도착지점의 route를 요청합니다.
                    RequestRoute(fromPosition, toPosition);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Handle the event of the longpress on the MapView.
        /// </summary>
        /// <param name="sender">Specifies the sender object</param>
        /// <param name="e">Specifies the occured event</param>
        private void MapViewLongPressed(object sender, MapGestureEventArgs e)
        {
            // Check the viewpage
            if (view == ViewPage.MAP)
            {
                // Remove all the map object from the map view
                s_mapview.RemoveAll();
                // Set the zoom level
                s_mapview.ZoomLevel = 13;
                // Move to the longpressed position
                s_mapview.Center = e.Geocoordinates;
                // Add the pin to the center positon of the map view
                s_mapview.Add(new global::Tizen.Maps.Pin(s_mapview.Center));
                // Request the address by the center position of the map view and display the address to the label of the starting position
                RequestAddress(fromLabel, s_mapview.Center.Latitude, s_mapview.Center.Longitude);
            }
            else if (view == ViewPage.ROUTE)
            {
                // Set the zoom level
                s_mapview.ZoomLevel = 13;
                // Check the text of the fromLabel and the toLabel. The route is being displayed if the text of the labels is not empty.
                if ((fromLabel.Text != "" && toLabel.Text != "") || (fromLabel.Text == "" && toLabel.Text == ""))
                {
                    // Remove the used resource
                    ClearData();
                }

                // Move to the longpressed position
                s_mapview.Center = e.Geocoordinates;

                // Check the text of the from the label
                if (fromPosition == null)
                {
                    // Add a marker to the center position
                    s_mapview.Add(new global::Tizen.Maps.Pin(s_mapview.Center));
                    // Request an address with the center position
                    RequestAddress(fromLabel, s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                    // Create the Geocoordinates from the center position
                    fromPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                }
                else if (fromLabel.Text != "" && toPosition == null)
                {
                    // Add a marker to the center position
                    s_mapview.Add(new global::Tizen.Maps.Sticker(s_mapview.Center));
                    // Request an address with the center position
                    RequestAddress(toLabel, s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                    // Create the Geocoordinates from the center position
                    toPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                    // Request a route with the fromPosition and the toPosition
                    RequestRoute(fromPosition, toPosition);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Handle the event of the longpress on the MapView.
        /// </summary>
        /// <param name="sender">Specifies the sender object</param>
        /// <param name="e">Specifies the occured event</param>
        private void MapViewLongPressed(object sender, MapGestureEventArgs e)
        {
            // Set the zoom level
            if (s_mapview.ZoomLevel < 13)
            {
                s_mapview.ZoomLevel = 13;
            }

            // Check the viewpage
            if (view == ViewPage.MAP)
            {
                // Remove the used data
                ClearData();
                // Move to the longpressed position
                s_mapview.Center = e.Geocoordinates;
                // Add the pin to the center positon of the map view
                s_mapview.Add(new Pin(s_mapview.Center));
                // Request the address by the center position of the map view and display the address to the label of the starting position
                RequestAddress(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
            }
            else if (view == ViewPage.ROUTE)
            {
                if (fromPosition != null && toPosition != null)
                {
                    // Remove the used data
                    ClearData();
                }

                // Move to the longpressed position
                s_mapview.Center = e.Geocoordinates;

                // Check the text of the from the label
                if (fromPosition == null)
                {
                    // Add a marker to the center position
                    s_mapview.Add(new Pin(s_mapview.Center));
                    // Create the Geocoordinates from the center position
                    fromPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                }
                else
                {
                    // Add a marker to the center position
                    s_mapview.Add(new Sticker(s_mapview.Center));
                    // Create the Geocoordinates from the center position
                    toPosition = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude);
                    // Request a route with the fromPosition and the toPosition
                    RequestRoute(fromPosition, toPosition);
                }
            }
        }
コード例 #4
0
 void Dummy(object sender, MapGestureEventArgs e)
 {
     // The implementation of Tizen.Maps needs to be changed to remove this method
 }