globe: github.com/mmcloughlin/globe Index | Files | Directories

package globe

import "github.com/mmcloughlin/globe"

Package globe builds 3D visualizations on the earth.

Index

Package Files

countries.geodata.go globe.go land.geodata.go

Variables

var DefaultStyle = Style{
    GraticuleColor: color.Gray{192},
    LineColor:      color.Gray{32},
    DotColor:       color.NRGBA{255, 0, 0, 255},
    Background:     color.White,
    LineWidth:      0.1,
    Scale:          0.7,
}

DefaultStyle specifies out-of-the box style options.

type Globe Uses

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

Globe is a globe visualization.

func New Uses

func New() *Globe

New constructs an empty globe with the default style.

func (*Globe) CenterOn Uses

func (g *Globe) CenterOn(lat, lng float64)

CenterOn rotates the globe to center on (lat, lng).

func (*Globe) DrawCountryBoundaries Uses

func (g *Globe) DrawCountryBoundaries(style ...Option)

DrawCountryBoundaries draws country boundaries on the globe. Uses the default LineColor unless overridden by style Options.

func (*Globe) DrawDot Uses

func (g *Globe) DrawDot(lat, lng float64, radius float64, style ...Option)

DrawDot draws a dot at (lat, lng) with the given radius. Uses the default DotColor unless overridden by style Options.

func (*Globe) DrawGraticule Uses

func (g *Globe) DrawGraticule(interval float64, style ...Option)

DrawGraticule draws a latitude/longitude grid at the given interval. Uses the default GraticuleColor unless overridden by style Options.

func (*Globe) DrawLandBoundaries Uses

func (g *Globe) DrawLandBoundaries(style ...Option)

DrawLandBoundaries draws land boundaries on the globe. Uses the default LineColor unless overridden by style Options.

func (*Globe) DrawLine Uses

func (g *Globe) DrawLine(lat1, lng1, lat2, lng2 float64, style ...Option)

DrawLine draws a line between (lat1, lng1) and (lat2, lng2) along the great circle. Uses the default LineColor unless overridden by style Options.

func (*Globe) DrawMeridian Uses

func (g *Globe) DrawMeridian(lng float64, style ...Option)

DrawMeridian draws the meridian at longitude lng. Uses the default GraticuleColor unless overridden by style Options.

func (*Globe) DrawMeridians Uses

func (g *Globe) DrawMeridians(interval float64, style ...Option)

DrawMeridians draws meridians at the given interval. Uses the default GraticuleColor unless overridden by style Options.

func (*Globe) DrawParallel Uses

func (g *Globe) DrawParallel(lat float64, style ...Option)

DrawParallel draws the parallel of latitude lat. Uses the default GraticuleColor unless overridden by style Options.

func (*Globe) DrawParallels Uses

func (g *Globe) DrawParallels(interval float64, style ...Option)

DrawParallels draws parallels at the given interval. Uses the default GraticuleColor unless overridden by style Options.

func (*Globe) DrawRect Uses

func (g *Globe) DrawRect(minlat, minlng, maxlat, maxlng float64, style ...Option)

DrawRect draws the rectangle with the given corners. Sides are drawn along great circles, as in DrawLine. Uses the default LineColor unless overridden by style Options.

func (*Globe) Image Uses

func (g *Globe) Image(side int) *image.RGBA

Image renders an image object for the visualization with dimensions (side, side).

func (*Globe) SavePNG Uses

func (g *Globe) SavePNG(filename string, side int) error

SavePNG writes the visualization to filename in PNG format with dimensions (side, side).

type Option Uses

type Option func(*Globe)

Option is a function that stylizes a globe.

func Color Uses

func Color(c color.Color) Option

Color uses the given color.

type Style Uses

type Style struct {
    GraticuleColor color.Color
    LineColor      color.Color
    DotColor       color.Color
    Background     color.Color
    LineWidth      float64
    Scale          float64
}

Style encapsulates globe display options.

Directories

PathSynopsis
examples

Package globe imports 4 packages (graph) and is imported by 3 packages. Updated 2017-07-12. Refresh now. Tools for package owners.