示例#1
0
        public HttpResponseMessage GetMapByDocumentId(int archiveId)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            MapDomain map = MapService.GetMapByDocumentId(archiveId);

            var response = new ItemResponse <MapDomain> {
                Item = map
            };

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
示例#2
0
        // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        public List <MapDomain> CreateMapRadiusBuyers(BlogInsertRequest model)
        {
            List <MapDomain> mapList = null;

            try
            {
                DataProvider.ExecuteCmd(GetConnection, "dbo.AddressTest_Find"
                                        , inputParamMapper : delegate(SqlParameterCollection paramCollection)
                {
                    paramCollection.AddWithValue("@latpoint", model.Latpoint);
                    paramCollection.AddWithValue("@lngpoint", model.Lngpoint);
                    paramCollection.AddWithValue("@radius", model.Radius);
                }, map : delegate(IDataReader reader, short set)
                {
                    var singleMap     = new MapDomain();
                    int startingIndex = 0; //startingOrdinal

                    singleMap.MapId          = reader.GetSafeInt32(startingIndex++);
                    singleMap.Address1       = reader.GetSafeString(startingIndex++);
                    singleMap.Address2       = reader.GetSafeString(startingIndex++);
                    singleMap.City           = reader.GetSafeString(startingIndex++);
                    singleMap.State          = reader.GetSafeString(startingIndex++);
                    singleMap.ZipCode        = reader.GetSafeString(startingIndex++);
                    singleMap.Latitude       = reader.GetSafeDecimal(startingIndex++);
                    singleMap.Longitude      = reader.GetSafeDecimal(startingIndex++);
                    singleMap.DistanceInMile = reader.GetSafeDouble(startingIndex++);

                    if (mapList == null)
                    {
                        mapList = new List <MapDomain>();
                    }

                    mapList.Add(singleMap);
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(mapList);
        }
示例#3
0
        public static MapDomain GetMapByDocumentId(int documentId)
        {
            if (documentId == 2)
            {
                return(null);
            }


            var bounds = new Models.Documents.Bounds
            {
                NorthEast = new Models.Documents.LatLng {
                    Lat = 33.37526554349371f, Lng = -118.14491271972658f
                },
                SouthWest = new Models.Documents.LatLng {
                    Lat = 33.95987773596287f, Lng = -117.39646911621095f
                },
            };

            var map = new MapDomain
            {
                MapId             = 1,
                DocumentId        = documentId,
                ResourceUrl       = "https://tile.loc.gov/image-services/iiif/service:gmd:gmd436:g4363:g4363o:la000032/full/pct:12.5/0/default.jpg",
                Bounds            = bounds,
                Rotation          = 0,
                Contributor       = "John Doe",
                Description       = "This is a map of Orange County from the 19th c. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
                InstitutionUrl    = "https://www.loc.gov/",
                IsPublished       = true,
                SourceInstitution = "Library of Congress",
                Title             = "OC at the end of the 19th c.",
                TypeId            = Enums.DocumentType.Map,
                Year = 1898
            };


            return(map);
        }