geomap

package
v0.0.0-...-6578659 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressComponent

type AddressComponent struct {
	LongName  string   `json:"long_name"`
	ShortName string   `json:"short_name"`
	Types     []string `json:"types"`
}

type Candidate

type Candidate struct {
	FormattedAddress string  `json:"formatted_address"`
	Name             string  `json:"name"`
	Photos           []Photo `json:"photos"`
	Rating           int     `json:"rating"`
}

type GoogleGeocodeResponse

type GoogleGeocodeResponse struct {
	Results []struct {
		AddressComponents []AddressComponent `json:"address_components"`
		FormattedAddress  string             `json:"formatted_address"`
		Geometry          GoogleGeometry     `json:"geometry"`
		PlaceID           string             `json:"place_id"`
		PlusCode          GooglePlusCode     `json:"plus_code"`
		Types             []string           `json:"types"`
	} `json:"results"`
	Status string `json:"status"`
}

func GetGeocode

func GetGeocode(ctx context.Context, params map[string]string) (GoogleGeocodeResponse, error)

GetReverseGeoCode will return GoogleReverseGeocodeResponse on success the example of usage is sending params that contains "address" and "key" (both of them are required) more references https://developers.google.com/maps/documentation/geocoding/intro#Geocoding

type GoogleGeometry

type GoogleGeometry struct {
	Location     GoogleLocation `json:"location"`
	LocationType string         `json:"location_type,omitempty"`
	Viewport     GoogleViewport `json:"viewport"`
}

type GoogleLocation

type GoogleLocation struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

type GoogleNearbySearchResponse

type GoogleNearbySearchResponse struct {
	HTMLAttributions []interface{} `json:"html_attributions"`
	Results          []struct {
		Geometry         GoogleGeometry `json:"geometry"`
		Icon             string         `json:"icon"`
		ID               string         `json:"id"`
		Name             string         `json:"name"`
		OpeningHours     OpeningHour    `json:"opening_hours"`
		Photos           []Photo        `json:"photos"`
		PlaceID          string         `json:"place_id"`
		PlusCode         GooglePlusCode `json:"plus_code"`
		PriceLevel       int            `json:"price_level,omitempty"`
		Rating           float64        `json:"rating"`
		Reference        string         `json:"reference"`
		Scope            string         `json:"scope"`
		Types            []string       `json:"types"`
		UserRatingsTotal int            `json:"user_ratings_total"`
		Vicinity         string         `json:"vicinity"`
	} `json:"results"`
	Status string `json:"status"`
}

func PlaceNearby

func PlaceNearby(ctx context.Context, params map[string]string) (GoogleNearbySearchResponse, error)

FindPlace will return GoogleNearbySearchResponse on success more references https://developers.google.com/places/web-service/search

type GooglePlaceDetailResponse

type GooglePlaceDetailResponse struct {
	HTMLAttributions []interface{} `json:"html_attributions"`
	Result           struct {
		AddressComponents        []AddressComponent  `json:"address_components"`
		AdrAddress               string              `json:"adr_address"`
		FormattedAddress         string              `json:"formatted_address"`
		FormattedPhoneNumber     string              `json:"formatted_phone_number"`
		Geometry                 GoogleGeometry      `json:"geometry"`
		Icon                     string              `json:"icon"`
		ID                       string              `json:"id"`
		InternationalPhoneNumber string              `json:"international_phone_number"`
		Name                     string              `json:"name"`
		OpeningHours             OpeningHour         `json:"opening_hours"`
		Photos                   []Photo             `json:"photos"`
		PlaceID                  string              `json:"place_id"`
		PlusCode                 GooglePlusCode      `json:"plus_code"`
		PriceLevel               int                 `json:"price_level"`
		Rating                   float64             `json:"rating"`
		Reference                string              `json:"reference"`
		Reviews                  []GooglePlaceReview `json:"reviews"`
		Scope                    string              `json:"scope"`
		Types                    []string            `json:"types"`
		URL                      string              `json:"url"`
		UserRatingsTotal         int                 `json:"user_ratings_total"`
		UtcOffset                int                 `json:"utc_offset"`
		Vicinity                 string              `json:"vicinity"`
		Website                  string              `json:"website"`
	} `json:"result"`
	Status string `json:"status"`
}

func PlaceDetail

func PlaceDetail(ctx context.Context, params map[string]string) (GooglePlaceDetailResponse, error)

FindPlace will return GooglePlaceDetailResponse on success more references https://developers.google.com/places/web-service/details

type GooglePlaceReview

type GooglePlaceReview struct {
	AuthorName              string `json:"author_name"`
	AuthorURL               string `json:"author_url"`
	Language                string `json:"language"`
	ProfilePhotoURL         string `json:"profile_photo_url"`
	Rating                  int    `json:"rating"`
	RelativeTimeDescription string `json:"relative_time_description"`
	Text                    string `json:"text"`
	Time                    int    `json:"time"`
}

type GooglePlaceSearchResponse

type GooglePlaceSearchResponse struct {
	Candidates []Candidate `json:"candidates"`
	Status     string      `json:"status"`
}

func FindPlace

func FindPlace(ctx context.Context, params map[string]string) (GooglePlaceSearchResponse, error)

FindPlace will return GooglePlaceSearchResponse on success more references https://developers.google.com/places/web-service/search

type GooglePlusCode

type GooglePlusCode struct {
	CompoundCode string `json:"compound_code"`
	GlobalCode   string `json:"global_code"`
}

type GoogleViewport

type GoogleViewport struct {
	Northeast GoogleLocation `json:"northeast"`
	SouthWest GoogleLocation `json:"southwest"`
}

type OpeningHour

type OpeningHour struct {
	OpenNow bool `json:"open_now"`
	Periods []struct {
		Open struct {
			Day  int    `json:"day"`
			Time string `json:"time"`
		} `json:"open"`
	} `json:"periods,omitempty"`
	WeekdayText []string `json:"weekday_text,omitempty"`
}

type Photo

type Photo struct {
	Height           int      `json:"height"`
	HTMLAttributions []string `json:"html_attributions"`
	PhotoReference   string   `json:"photo_reference"`
	Width            int      `json:"width"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL