Documentation ¶
Index ¶
- Constants
- type Address
- type Client
- type Coordinates
- type Cost
- type Error
- type FuelOptions
- type GeocodeRequest
- type GeocodeResponse
- type Geometry
- type GeometryDrawerItem
- type Legend
- type LineOptions
- type Map
- type MapRouteRequest
- type Options
- type Pin
- type PinDrawer
- type Point
- type RGB
- type Route
- type RouteLabelOptions
- type RouteLegOptions
- type RouteLineOptions
- type RouteRequest
- type RouteResponse
- type SingleMapRequest
- type SpeedLimitInfo
- type StopLocation
- type TextOptions
- type TruckConfig
- type Viewport
Constants ¶
View Source
const (
ClientVersion = "0.1.3"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { StreetAddress string `json:"StreetAddress"` City string `json:"City"` State string `json:"State"` Zip string `json:"Zip"` County string `json:"County"` Country string `json:"Country"` SPLC string `json:"SPLC"` CountryPostalFilter int `json:"CountryPostalFilter"` AbbreviationFormat int `json:"AbbreviationFormat"` }
type Client ¶
type Client struct {
APIKey string
}
func New ¶
New instantiates new PCMiler client with your API key and optional dataset, defaults to Current
func (*Client) Geocode ¶
func (c *Client) Geocode(request GeocodeRequest) ([]GeocodeResponse, error)
func (*Client) RoutePath ¶
func (c *Client) RoutePath(request RouteRequest) (RouteResponse, error)
type Coordinates ¶
type FuelOptions ¶
type GeocodeRequest ¶
type GeocodeRequest struct { // Geocoding Street string `url:"street,omitempty"` City string `url:"city,omitempty"` State string `url:"state,omitempty"` Postcode string `url:"postcode,omitempty"` SearchString string `url:"searchString,omitempty"` PostcodeFilter string `url:"postcodeFilter,omitempty"` CitySearchFilter string `url:"citySearchFilter,omitempty"` Splc string `url:"splc,omitempty"` List int `url:"list,omitempty"` // Reverse geocoding Coords Coordinates `url:"-"` MatchNamedRoadsOnly bool `url:"matchNamedRoadsOnly,omitempty"` MaxCleanupMiles float64 `url:"maxCleanupMiles,omitempty"` IncludePostedSpeedLimit bool `url:"includePostedSpeedLimit,omitempty"` Heading float32 `url:"heading,omitempty"` IncludeLinkInfo bool `url:"includeLinkInfo,omitempty"` Timestamp string `url:"timestamp,omitempty"` Region string `url:"region,omitempty"` Dataset string `url:"dataset,omitempty"` }
type GeocodeResponse ¶
type GeocodeResponse struct { Address Address `json:"Address"` Coords Coordinates `json:"Coords"` Region int `json:"Region"` Label string `json:"Label"` PlaceName string `json:"PlaceName"` Errors []Error `json:"Errors"` ConfidenceLevel string `json:"ConfidenceLevel"` DistanceFromRoad float64 `json:"DistanceFromRoad"` SpeedLimitInfo SpeedLimitInfo `json:"SpeedLimitInfo"` }
type GeometryDrawerItem ¶
type GeometryDrawerItem struct {
Color []RGB `json:"Color"`
}
type LineOptions ¶
type LineOptions struct {
RouteLineOptions RouteLineOptions `json:"RouteLineOptions"`
}
type Map ¶
type Map struct { Viewport Viewport `json:"Viewport"` Projection int `json:"Projection"` Style int `json:"Style"` ImageOption int `json:"ImageOption"` Width int `json:"Width"` Height int `json:"Height"` Drawers []int `json:"Drawers"` LegendDrawer []Legend `json:"LegendDrawer"` GeometryDrawer []GeometryDrawerItem `json:"GeometryDrawer"` PinDrawer PinDrawer `json:"PinDrawer"` }
type MapRouteRequest ¶
type Options ¶
type Options struct { AFSetIDs string `json:"AFSetIDs"` BordersOpen bool `json:"BordersOpen"` ClassOverrides int `json:"ClassOverrides"` DistanceUnits int `json:"DistanceUnits"` ElevLimit int `json:"ElevLimit,omitempty"` FerryDiscourage bool `json:"FerryDiscourage"` FuelRoute bool `json:"FuelRoute"` HazMatType int `json:"HazMatType"` HighwayOnly bool `json:"HighwayOnly"` HubRouting bool `json:"HubRouting"` OverrideRestrict bool `json:"OverrideRestrict"` RouteOptimization int `json:"RouteOptimization"` RoutingType int `json:"RoutingType"` TollDiscourage bool `json:"TollDiscourage"` TruckConfig *TruckConfig `json:"TruckCfg,omitempty"` UseAvoidsAndFavors bool `json:"UseAvoidsAndFavors"` VehicleType int `json:"VehicleType"` }
type Pin ¶
type Pin struct { Category int `json:"Category"` ID int `json:"ID"` Image string `json:"Image"` Label string `json:"Label"` Point Coordinates `json:"Point"` }
type Route ¶
type Route struct { RouteID string `json:"RouteId"` Stops []StopLocation `json:"Stops"` Options *Options `json:"Options"` FuelOptions *FuelOptions `json:"FuelOptions"` DrawLeastCost bool `json:"DrawLeastCost"` RouteLegOptions RouteLegOptions `json:"RouteLegOptions"` StopLabelDrawer int `json:"StopLabelDrawer"` }
type RouteLabelOptions ¶
type RouteLegOptions ¶
type RouteLegOptions struct { LineOptions LineOptions `json:"LineOptions"` TextOptions TextOptions `json:"TextOptions"` }
type RouteLineOptions ¶
type RouteRequest ¶
type RouteRequest struct { Stops []Coordinates `url:"-"` AvoidTolls bool `url:"avoidTolls,omitempty"` HubRouting bool `url:"hubRouting,omitempty"` VehHeight string `url:"vehHeight,omitempty"` VehLength string `url:"vehLength,omitempty"` StopsAsViaPoints bool `url:"stopsAsViaPoints,omitempty"` AvoidFavors bool `url:"avoidFavors,omitempty"` AfSetIDs string `url:"afSetIDs,omitempty"` VehWeight string `url:"vehWeight,omitempty"` RouteOpt string `url:"routeOpt,omitempty"` RouteType string `url:"routeType,omitempty"` VehType string `url:"vehType,omitempty"` OverrideClass string `url:"overrideClass,omitempty"` Axles int `url:"axles,omitempty"` VehDimUnits string `url:"vehDimUnits,omitempty"` OpenBorders bool `url:"openBorders,omitempty"` LCV bool `url:"LCV,omitempty"` HighwayOnly bool `url:"hwyOnly,omitempty"` DistUnits string `url:"distUnits,omitempty"` OverrideRestrict bool `url:"overrideRestrict,omitempty"` HazMat string `url:"hazMat,omitempty"` VehWidth string `url:"vehWidth,omitempty"` Region string `url:"region,omitempty"` Dataset string `url:"dataset,omitempty"` }
func (*RouteRequest) AddStop ¶
func (r *RouteRequest) AddStop(stop Coordinates)
type RouteResponse ¶
type SingleMapRequest ¶
type SingleMapRequest struct { Point1 Coordinates `url:"-"` Point2 Coordinates `url:"-"` Style string `url:"style,omitempty"` Width int `url:"width,omitempty"` Height int `url:"height,omitempty"` SRS string `url:"srs,omitempty"` Region string `url:"region,omitempty"` Dataset string `json:"dataset,omitempty"` Imgsrc string `json:"imgsrc,omitempty"` }
type SpeedLimitInfo ¶
type StopLocation ¶
type TextOptions ¶
type TextOptions struct {
RouteLabelOptions RouteLabelOptions `json:"RouteLabelOptions"`
}
type TruckConfig ¶
type Viewport ¶
type Viewport struct { Center *Coordinates `json:"Center"` ScreenCenter *Point `json:"ScreenCenter"` ZoomRadius float64 `json:"ZoomRadius"` CornerA *Coordinates `json:"CornerA"` CornerB *Coordinates `json:"CornerB"` Region int `json:"Region"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.