What's New in Version 1.1

Map Tiles

ALKMaps version 1.1 adds support for map tiles. Map tiles will help improve the user experience by allowing the browser to cache tile images and improve map rendering times over the course of a user's session.

Rather than each pan and zoom of the map creating an entirely new image, each zoom level of the map is broken into 256 pixel square images that are loaded and cached by the browser.

Map tiles are now enabled by default to provide the best experience. See the Single Image Maps section below if you have the need for customized map drawers.

Spherical Mercator support

ALKMaps now supports Spherical Mercator projection in both map tile and single image tile configurations. For details about configuring your map and using spherical mercator projections see the Spherical Mercator section of the Layers page.

Easier map creation

Adding a map to your application is now easier in version 1.1. You no longer need to explicitly declare the BaseMap layer when creating a map. When a new map object is created, it will automatically create the corresponding BaseMap layer. However you will still be able to add a new BaseMap layer to the map which will replace the automatically created one.

var map = new ALKMaps.Map("map");

map.setCenter(new ALKMaps.LonLat(-95, 35), 3).transform(new ALKMaps.Projection("EPSG:4326"), map.getProjectionObject());

Migrating

Version 1.1 of the ALKMaps API is backward-compatible with older version of the toolkit, so migration is easy.

Migrating from ALKMaps 1.0 or 0.5

To upgrade from version 1.0 or 0.5 of ALKMaps to version 1.1, change the script tag in the HTML of all pages to reference the 1.1 version of the JavaScript file.

<script src="https://maps.alk.com/api/1.0/alkmaps.js" type="text/javascript"></script>

or

<script src="https://maps.alk.com/api/0.5/alkmaps.js" type="text/javascript"></script>

should be changed to

<script src="https://maps.alk.com/api/1.1/alkmaps.js" type="text/javascript"></script>

Single Image Maps

Map tiles are now enabled by default to provide the best experience. However, not every drawer option is available in the map tiles. See the Map Tiles section in the Layers page of this guide for more details on what drawers can be customized. To enable the map to use single images rather than map tiles, change your map instantiation to contain the singleTile: true option.

Projections

If your visualization needs require the use of a map in the spherical mercator projection, you'll need to change the map settings as well as transform all longitude and latitude values sent to and from the map.

//From longitude/latitude to spherical mercator map
var lonLat = new ALKMaps.LonLat(-100, 64);
lonLat.transform( new ALKMaps.Projection("EPSG:4326"), map.getProjectionObject() );

More information about using the map with a spherical mercator projection, see the Spherical Mercator section of the Layers page.