ImgHandler

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLegend

func CreateLegend(items []LegendItem) ([]byte, error)

func EmbedEagleEye

func EmbedEagleEye(imageA, imageB []byte, scale float64, padding int, position Position) ([]byte, error)

EmbedEagleEye 将A图片镶嵌在B图片的指定位置作为鹰眼图 imageA: 要镶嵌的图片数据 imageB: 主图片数据 scale: A图片相对于B图片的缩放比例 (0-1之间,例如0.2表示A图片宽度为B图片宽度的20%) padding: 鹰眼图距离边角的内边距(像素) position: 鹰眼图的位置(左上、右上、左下、右下) 返回合成后的图片数据

func EmbedEagleEyeWithDefaults

func EmbedEagleEyeWithDefaults(imageA, imageB []byte) ([]byte, error)

EmbedEagleEyeWithDefaults 使用默认参数的便捷函数 默认缩放比例为0.2,内边距为10像素,位置为右下角

func TLImgMake

func TLImgMake(tableName string) ([]byte, error)

TLImgMake 根据表名生成图例图片 参数:

tableName: 数据表名称,用于获取颜色配置

返回:

[]byte: 生成的图例图片字节数据
error: 错误信息,如果执行成功则为 nil

Types

type LegendItem

type LegendItem struct {
	Property string `json:"Property"`
	Color    string `json:"Color"`
	GeoType  string `json:"GeoType"`
}

type Position

type Position int

Position 定义鹰眼图的位置

const (
	PositionTopLeft Position = iota
	PositionTopRight
	PositionBottomLeft
	PositionBottomRight
)

Jump to

Keyboard shortcuts

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