wboykinm

Wax Attempt 1

Aug 29th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.90 KB | None | 0 0
  1. <script src='http://maps.google.com/maps/api/js?sensor=false' type='text/javascript'></script>
  2. <script src='http://www.geosprocket.com/mapbox-wax/dist/wax.g.js' type='text/javascript'></script>
  3. <link href='http://www.geosprocket.com/mapbox-wax/theme/controls.css' rel='stylesheet' type='text/css' />
  4.  
  5. <script type="text/javascript">
  6. var tilejson = {
  7.   tilejson: '1.0.0',
  8.   scheme: 'tms',
  9.   tiles: ['http://a.tiles.mapbox.com/landplanner/1.0.0/landplanner5/{z}/{x}/{y}.png'],
  10.   formatter: function(options, data) { return data.NAME }
  11. };
  12. </script>
  13.  
  14. <script type="text/javascript">
  15.   var geocoder;
  16.   var map;
  17.   function initialize() {
  18.     geocoder = new google.maps.Geocoder();
  19.     var latlng = new google.maps.LatLng(38.184, -78.687);
  20.     var myOptions = {
  21.       zoom: 15,
  22.       center: latlng,
  23.       mapTypeId: google.maps.MapTypeId.HYBRID
  24.     }
  25.     map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  26. map.mapTypes.set('mb', new wax.g.connector(tilejson));
  27. map.setMapTypeId('mb');
  28. wax.g.interaction(tilejson, map);
  29.  }
  30.  
  31.  
  32.   function codeAddress() {
  33.     var address = document.getElementById("address").value;
  34.     geocoder.geocode( { 'address': address}, function(results, status) {
  35.       if (status == google.maps.GeocoderStatus.OK) {
  36.         map.setCenter(results[0].geometry.location);
  37.         var marker = new google.maps.Marker({
  38.             map: map,
  39.             position: results[0].geometry.location
  40.         });
  41.       } else {
  42.         alert("Geocode was not successful for the following reason: " + status);
  43.       }
  44.     });
  45.   }
  46. </script>
  47.  
  48. <!--var m = new google.maps.Map(
  49.  document.getElementById('google-map'), {
  50.    center: new google.maps.LatLng(0, 0),
  51.    disableDefaultUI: true,
  52.    zoom: 1,
  53.    mapTypeId: google.maps.MapTypeId.HYBRID });
  54. m.mapTypes.set('mb', new wax.g.connector(tilejson));
  55. m.setMapTypeId('mb');
  56. wax.g.interaction(m, tilejson);
  57. -->
Advertisement
Add Comment
Please, Sign In to add comment