Пример #1
0
	public void MapItemsRequest(object sender, MapItemsRequestEventArgs eventArgs)
	{
		double minZoom = eventArgs.MinZoom;
		Location upperLeft = eventArgs.UpperLeft;
		Location lowerRight = eventArgs.LowerRight;

		if (this.document == null)
			return;

		if (minZoom == 3)
		{
			// request areas
			List<StoreLocation> list = this.GetStores(
				upperLeft.Latitude,
				upperLeft.Longitude,
				lowerRight.Latitude,
				lowerRight.Longitude,
				StoreType.Area);

			eventArgs.CompleteItemsRequest(list);
		}

		if (minZoom == 9)
		{
			// request areas
			List<StoreLocation> list = this.GetStores(
				upperLeft.Latitude,
				upperLeft.Longitude,
				lowerRight.Latitude,
				lowerRight.Longitude,
				StoreType.Store);

			eventArgs.CompleteItemsRequest(list);
		}
	}
Пример #2
0
        /// <summary>
        /// Callback of the GetStores async call.
        /// The method uses the web service response to building objects on the dynamic layer.
        /// </summary>
        internal void SetStores(List <StoreLocation> list, MapItemsRequestEventArgs request)
        {
            if (list.Count == 0)
            {
                return;
            }

            foreach (StoreLocation storeLocation in list)
            {
                // Shifts the store to the current portion of the request.
                storeLocation.Longitude = this.TryGetLongitudeMatchInRange(storeLocation.Longitude, request.UpperLeft.Longitude, request.LowerRight.Longitude);
            }

            request.CompleteItemsRequest(list);
        }
        /// <summary>
        /// Callback of the GetStores async call.
        /// The method uses the web service response to building objects on the dynamic layer.
        /// </summary>
		internal void SetStores(List<StoreLocation> list, MapItemsRequestEventArgs request)
        {
			request.CompleteItemsRequest(list);
        }