| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 | <meta name="viewport" content="user-scalable=no, width=device-width" /> |
| 6 | <meta name="apple-mobile-web-app-capable" content="yes" /> |
| 7 | |
| 8 | <title>Simple Maps,support pan and zoom navigation</title> |
| 9 | <style type="text/css"> |
| 10 | @import "../../../../dojo/resources/dojo.css"; |
| 11 | @import "../../../../dijit/tests/css/dijitTests.css"; |
| 12 | @import "../../../../dijit/themes/tundra/tundra.css"; |
| 13 | @import "../resources/Map.css"; |
| 14 | .mapContainer { |
| 15 | width: 680px; |
| 16 | height: 600px; |
| 17 | border: solid 1px; |
| 18 | } |
| 19 | |
| 20 | .mapVerticalContainer { |
| 21 | display: none; |
| 22 | width: 405px; |
| 23 | height: 500px; |
| 24 | border: solid 1px; |
| 25 | } |
| 26 | </style> |
| 27 | <script type="text/javascript" data-dojo-config="parseOnLoad:true,gfxRenderer:'svg,canvas,vml,silverlight'" src="../../../../dojo/dojo.js"></script> |
| 28 | <script type="text/javascript"> |
| 29 | var isTouchDevice = dojo.isIos || (navigator.userAgent.toLowerCase().indexOf("android") > -1) |
| 30 | || (navigator.userAgent.toLowerCase().indexOf("blackberry") > -1); |
| 31 | </script> |
| 32 | <script type="text/javascript"> |
| 33 | dojo.require("dojox.geo.charting.Map"); |
| 34 | dojo.requireIf(isTouchDevice,"dojox.geo.charting.TouchInteractionSupport"); |
| 35 | dojo.requireIf(!isTouchDevice,"dojox.geo.charting.MouseInteractionSupport"); |
| 36 | dojo.require("dojox.geo.charting.KeyboardInteractionSupport"); |
| 37 | |
| 38 | dojo.addOnLoad(function(){ |
| 39 | var map = new dojox.geo.charting.Map("USStates", "../resources/data/USStates.json"); |
| 40 | map.setMarkerData("../resources/markers/USStates.json"); |
| 41 | if (!isTouchDevice) { |
| 42 | var mouseInteraction = new dojox.geo.charting.MouseInteractionSupport(map,{enablePan:true,enableZoom:true}); |
| 43 | mouseInteraction.connect(); |
| 44 | } else { |
| 45 | var touchInteraction = new dojox.geo.charting.TouchInteractionSupport(map,{}); |
| 46 | touchInteraction.connect(); |
| 47 | } |
| 48 | var keyboardInteraction = new dojox.geo.charting.KeyboardInteractionSupport(map, {enableZoom: true}); |
| 49 | keyboardInteraction.connect(); |
| 50 | dojo.connect(window,"onresize",this,function(){map.resize(true,true);}); |
| 51 | |
| 52 | }); |
| 53 | </script> |
| 54 | </head> |
| 55 | <body class="tundra"> |
| 56 | <p>Keyboard Tips: Use <b>TAB</b> to focus the map, then use <b>up/down/left/right</b> to go around the map, zoom in by <b>SPACE</b> and zoom out by <b>ESC</b>.</p> |
| 57 | <div class="mapContainer" id="USStates"></div> |
| 58 | </body> |
| 59 | </html> |