Skip to end of metadata
Go to start of metadata

This documentation is no longer actively supported and may be out of date. Going forward, please visit and bookmark our new site (https://docs.phunware.com/) for up-to-date documentation.

Create a Floor

 

This method is used to create a floor object. The body of the request contains a JSON payload defining the floor.  This will create a draft floor.  Floors may only be created on draft buildings.

Method

POST

URL

http://map-api.phunware.com/v1.1/floors

Headers

X-Auth (see Security)

Request Body

Required parameters are underlined.

Parameter

Value

Description

venueGuid

string

The identifier of the venue that this floor belongs to.

name

string

The name of the floor.

originalMapUrl

string

The location of the image used in map displays of this floor. By convention, it should be of the format

http://lbs-<env>.s3.amazonaws.com/venues/<venueGuid>/maps/<floorId>.<suffix>, where <env> is "dev", "stage", or "prod", <venueGuid> and <floorId> are the identifiers of the venue and floor, and <suffix> is the extension type of the image file (e.g. ".jpg", ".png").

level

integer

The level of this floor.

isOutdoor

Boolean

Describes whether this floor is outdoors.

width

integer

The width of the floor.

height

integer

The height of this floor.

offsetX

integer

The offset in the x-direction.

offsetY

integer

The offset in the y-direction.

locationMapHierarchy

string

By convention, a string which is a concatenation of the campus name, building name, and floor name separated by the '>' character.

buildingId

integer

The identifier of the building that this floor belongs to.

maxZoomLevel

integer

The maximum zoom level for this floor.

referencePoints

object

An object to help locate the floor properly on the map. It contains:

  • location objects for the top left, top right, bottom left and bottom right latitude and longitude values
  • portal object containing top right and bottom left locations for use by the portal in fixating the floor on the display
  • rotation value in decimal degrees
scalePctintegerThe scale of the map. Valid range is 25-400 inclusive.
{
    "venueGuid": <string>,
    "buildingId": <integer>,
    "name": <string>,
    "originalMapUrl": <string>,
    "level": <integer>,
    "isOutdoor": <Boolean>,
    "width": <decimal>,
    "height": <decimal>,
    "offsetX": <integer>,
    "offsetY": <integer>,
    "locationMapHierarchy": <string>,
    "maxZoomLevel": <integer>,
    "referencePoints": 
	{
        "rotation": <decimal>,
        "portal": 
		{
            "topRight": 
			{
                "latitude": <decimal>,
                "longitude": <decimal>
            },
            "bottomLeft": 
			{
                "latitude": <decimal>,
                "longitude": <decimal>
            }
        },
        "topLeft": 
		{
            "latitude": <decimal>,
            "longitude": <decimal>
        },
        "topRight": 
		{
            "latitude": <decimal>,
            "longitude": <decimal>
        },
        "bottomLeft": 
		{
            "latitude": <decimal>,
            "longitude": <decimal>
        },
        "bottomRight": 
		{
            "latitude": <decimal>,
            "longitude": <decimal>
		}
    },
    "scalePct": <integer>
} 

Example Request

POST the following request body to: http://map-api.phunware.com/v1.1/floors

{
    "venueGuid": "03521872-2845-4024-896d-5fa0ab555c12",
    "buildingId": 6891,
    "name": "Level One",
    "originalMapUrl": "http://image.com/level1.pdf",
    "level": 1,
    "isOutdoor": false,
    "width": 100.6,
    "height": 200.42,
    "offsetX": 0,
    "offsetY": 0,
    "locationMapHierarchy": "somecampus>somebuilding>somefloor",
    "maxZoomLevel": 3,
    "referencePoints": 
	{
        "rotation": 214.7,
        "portal": 
		{
            "topRight": 
			{
                "latitude": 33.77403309960294,
                "longitude": -84.32867120304763
            },
            "bottomLeft": 
			{
                "latitude": 33.7740738782866,
                "longitude": -84.32673443277963
            }
        },
        "topLeft": 
		{
            "latitude": 33.773309,
            "longitude": -84.327331
        },
        "topRight": 
		{
            "latitude": 33.774033,
            "longitude": -84.328671
        },
        "bottomLeft": 
		{
            "latitude": 33.774073,
            "longitude": -84.326734
        },
        "bottomRight": 
		{
            "latitude": 33.774797,
            "longitude": -84.328074
        }
    },
    "scalePct": 30
} 

Response

A successful response will have a 200 status code and a body containing the newly created floor's ID:

{
    "data": 
	{
        "id": <integer>
    }
}

See Mapping API Response Handling for error payloads.

Example Response

Example body of successful response:

{
    "data": 
	{
        "id": 17
    }
} 

ON THIS PAGE

 

 

  • No labels