Beispiel #1
0
        ///<summary>
        ///PUT v1/pin/update
        ///This method updates a single map point and returns the updated map point object
        ///</summary>
        ///<remarks>
        ///Put format: json
        ///</remarks>
        ///<example>
        ///Resource URL
        ///http://api.pinmaps.net/v1/pin/update.json
        /// </example>
        public static void UpdateMapPoint()
        {
            try
            {
                Console.Clear();
                MapPointRequest point = new MapPointRequest
                {
                    Address           = "EWR",
                    PointName         = "Newark Liberty International",
                    UserName          = UserName,
                    MapId             = 0,        // Enter your map ID here
                    MapPointId        = 0,        // Enter your map point ID here
                    MapType           = "HYBRID", // ROADMAP,  SATELLITE,  HYBRID,  TERRAIN
                    PointInformation  = "",
                    DeveloperApiLogin = DeveloperApiLogin,
                    DeveloperApiKey   = DeveloperApiKey,
                    UserApiKey        = UserApiKey
                };

                RestFactory <MapPointRequest> restRepository = new RestFactory <MapPointRequest>();
                restRepository.ApiRequest(point, ApiBaseUrl + "pin/update", "PUT");
                Console.WriteLine("");
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}", ex.Message);
                Console.WriteLine("");
            }
        }
Beispiel #2
0
        ///<summary>
        ///DELETE v1/pin/destroy
        ///This method deletes a single map point object by map point ID
        ///</summary>
        ///<remarks>
        ///Delete format: json
        ///</remarks>
        ///<example>
        ///Resource URL
        ///http://api.pinmaps.net/v1/pin/destroy.json
        /// </example>
        public static void DeleteMapPoint()
        {
            try
            {
                Console.Clear();
                MapPointRequest point = new MapPointRequest
                {
                    MapPointId        = 0, // Enter your map point ID here
                    UserName          = UserName,
                    DeveloperApiLogin = DeveloperApiLogin,
                    DeveloperApiKey   = DeveloperApiKey,
                    UserApiKey        = UserApiKey
                };

                RestFactory <MapPointRequest> restRepository = new RestFactory <MapPointRequest>();
                restRepository.ApiRequest(point, ApiBaseUrl + "pin/destroy", "DELETE");
                Console.WriteLine("");
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}", ex.Message);
                Console.WriteLine("");
            }
        }