func (m *Map) Vec(c Coord) pixel.Vec {
	return c.Vec(m.Zoom()).Add(m.Bounds().Min).Sub(m.origin)
}
Vec returns the coordinate's pixel assuming the camera is at 0,0
and the map was drawn with the identify matrix
package slippy
import "github.com/faiface/pixel"
type Options struct {
	Center Coord
	Zoom   int
	Bounds pixel.Rect
}
type Map struct {
	opts   Options
	origin pixel.Vec
	area   pixel.Rect
	tiles  []ImageTile
	loader *Loader
}
func New(opts Options) *Map {
	m := &Map{
		opts:   opts,
		loader: NewLoader(),
	}
	m.init()
	return m
}
func (m *Map) init() {
	var (
		opts   = m.opts
		bounds = opts.Bounds
		half   = bounds.Min.To(bounds.Max).Scaled(0.5)
	)
	m.origin = opts.Center.Vec(opts.Zoom).Sub(half)
	m.area = bounds.Moved(m.origin)
	m.tiles = fromRect(m.area, opts.Zoom)
}
func (m *Map) SetOptions(opts Options) {
	m.opts = opts
	m.init()
}
func (m *Map) Zoom() int {
	return m.opts.Zoom
}
func (m *Map) SetZoom(zoom int) {
	if 1 <= zoom && zoom <= MaxZ {
		m.opts.Zoom = zoom
		m.init()
	}
}
func (m *Map) Bounds() pixel.Rect {
	return m.opts.Bounds
}
func (m *Map) SetBounds(bounds pixel.Rect) {
	m.opts.Bounds = bounds
	m.init()
}
func (m *Map) Center() Coord {
	return m.opts.Center
}
func (m *Map) Visible(c Coord) bool {
	return m.Bounds().Contains(m.Vec(c))
}
func (m *Map) CenterVec() pixel.Vec {
	return m.Center().Vec(m.Zoom())
}
func (m *Map) SetCenter(center Coord) {
	m.opts.Center = center
	m.init()
}
func (m *Map) SetCenterVec(center pixel.Vec) {
	m.opts.Center = FromVec(center, m.Zoom())
	m.init()
}
func (m *Map) Coord(v pixel.Vec) Coord {
	return FromVec(v.Sub(m.Bounds().Min).Add(m.origin), m.Zoom())
}