mapbuilder

package
v0.0.0-...-7b92be5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SCALE_10M = "10m"
View Source
const SCALE_110M = "110m"
View Source
const SCALE_50M = "50m"

Variables

View Source
var CountriesMetadata = map[string]map[string]map[string]string{}
View Source
var CountryShapes = map[string]*CountryShape{}

Functions

func LoadCountriesDB

func LoadCountriesDB() error

func LoadCountry

func LoadCountry(scale, countryFile string)

func RequestCountry

func RequestCountry(isoCode string, scale string) ([]byte, error)

func RunWebServer

func RunWebServer(port int)

func SetupCORS

func SetupCORS(w http.ResponseWriter, r *http.Request)

Types

type CountryParams

type CountryParams struct {
	// contains filtered or unexported fields
}

type CountryShape

type CountryShape struct {
	ShapeParams
	// contains filtered or unexported fields
}

func CreateCountryShape

func CreateCountryShape() *CountryShape

func (*CountryShape) GetSVG

func (shape *CountryShape) GetSVG(params TransformParams, countryParams CountryParams) string

func (*CountryShape) GetSVGPath

func (shape *CountryShape) GetSVGPath(params TransformParams, countryParams CountryParams) string

type MapRequest

type MapRequest struct {
	Scale     string   `json:"scale"`
	Width     float64  `json:"width"`
	Height    float64  `json:"height"`
	Countries []string `json:"countries"`
}

type MapShape

type MapShape struct {
	ShapeParams
	// contains filtered or unexported fields
}

func CreateMapShape

func CreateMapShape() *MapShape

func (*MapShape) GetSVG

func (m *MapShape) GetSVG(params TransformParams, countryParams CountryParams) string

type Polygon

type Polygon [][]float64

type ShapeParams

type ShapeParams struct {
	// contains filtered or unexported fields
}

type TransformParams

type TransformParams struct {
	// contains filtered or unexported fields
}

func PrepareTransformParams

func PrepareTransformParams(transform TransformParams, shape ShapeParams) TransformParams

Jump to

Keyboard shortcuts

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