-
Notifications
You must be signed in to change notification settings - Fork 165
Returns a new Map object.
-
width
: An integer width for the map. Normally for tiled rendering this value is some power of 2, like256
or512
and matches the value forheight
. -
height
: An integer height for the map. Normally for tiled rendering this value is some power of 2, like256
or512
and matches the value forwidth
. -
srs
(optional): A string. If provided, this sets the Map spatial reference system (aka projection). The format is the proj4 syntax. The default if you do not provide a value is+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
(which is equivalent to the shorthand of+init=epsg:4326
and comes from Mapnik core). The most commonsrs
for tiled rendering is spherical mercator which is+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
(which is equivalent to the shorthand of+init=epsg:3857
). Note: Mapnik >= 2.2.x has special handling for transforming between these common projections and detects them here.
Renders the data in the map to a given surface
. A surface can either be a mapnik.VectorTile
, a mapnik.Image
, or a mapnik.Grid
.
Returns a new VectorTile object for a given xyz
tile uri. The assumed projection of the data is Spherical Mercator. Learn more about tile addressing at Maptiler.org.
-
z
: An integer zoom level. -
x
: An integer x coordinate. -
y
: An integer y coordinate.
Get the protobuf-encoded Buffer from the vector tile object. This should then be passed through zlib.deflate
to compress further before storing or sending over http. Remember to set content-encoding:deflate
if you want an http client to know to automatically uncompress. Or use zlib.inflate
to uncompress yourself if working serverside.
TODO (rest of api docs - tracking at https://github.com/mapnik/node-mapnik/issues/235).
You can also take a look at the node-mapnik typescript definition file which offers intellisense in IDEs.