HOME BLOG

MAPAS API

Galeria de exemplos: Mapa com animação

Este exemplo faz deslocar o mapa utilizando uma animação. Para ver o exemplo a funcionar, carregue no botão "move"

				<html>
					<head>
						<title>Map Animation</title>
						<script type="text/javascript" src="http://js.sapo.pt/Bundles/SAPOMapsAPI.js"></script>
						<script type='text/javascript'>
							
							var map = false;
							function init(){
								map = new SAPO.Maps.Map('map');
							}
							
							function move(){
								map.pan(-100, 100, {animate: true, dragging: true});
							}
							
						</script>
					</head>
					<body onload="init();">
						<div id="map" style="width:980px; height: 400px"></div>
						<input type="button" onclick="move();" value="Move" />
					</body>
				</html>