The Wiki for Tale 6 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "User:Sneferu/Marble and dowsing"

From ATITD6
Jump to navigationJump to search
Line 30: Line 30:
 
<br><br>
 
<br><br>
 
</googlemap>
 
</googlemap>
 +
 +
 +
 +
// Create an object containing LatLng, population.
 +
var citymap = {};
 +
citymap['chicago'] = {
 +
  center: new google.maps.LatLng(41.878113, -87.629798),
 +
  population: 2842518
 +
};
 +
citymap['newyork'] = {
 +
  center: new google.maps.LatLng(40.714352, -74.005973),
 +
  population: 8143197
 +
};
 +
citymap['losangeles'] = {
 +
  center: new google.maps.LatLng(34.052234, -118.243684),
 +
  population: 3844829
 +
}
 +
var cityCircle;
 +
 +
function initialize() {
 +
  var mapOptions = {
 +
    zoom: 4,
 +
    center: new google.maps.LatLng(37.09024, -95.712891),
 +
    mapTypeId: google.maps.MapTypeId.TERRAIN
 +
  };
 +
 +
  var map = new google.maps.Map(document.getElementById('map-canvas'),
 +
      mapOptions);
 +
 +
  for (var city in citymap) {
 +
    // Construct the circle for each value in citymap. We scale population by 20.
 +
    var populationOptions = {
 +
      strokeColor: '#FF0000',
 +
      strokeOpacity: 0.8,
 +
      strokeWeight: 2,
 +
      fillColor: '#FF0000',
 +
      fillOpacity: 0.35,
 +
      map: map,
 +
      center: citymap[city].center,
 +
      radius: citymap[city].population / 20
 +
    };
 +
    cityCircle = new google.maps.Circle(populationOptions);
 +
  }
 +
}
 +
 +
google.maps.event.addDomListener(window, 'load', initialize);

Revision as of 22:18, 8 August 2013



// Create an object containing LatLng, population. var citymap = {}; citymap['chicago'] = {

 center: new google.maps.LatLng(41.878113, -87.629798),
 population: 2842518

}; citymap['newyork'] = {

 center: new google.maps.LatLng(40.714352, -74.005973),
 population: 8143197

}; citymap['losangeles'] = {

 center: new google.maps.LatLng(34.052234, -118.243684),
 population: 3844829

} var cityCircle;

function initialize() {

 var mapOptions = {
   zoom: 4,
   center: new google.maps.LatLng(37.09024, -95.712891),
   mapTypeId: google.maps.MapTypeId.TERRAIN
 };
 var map = new google.maps.Map(document.getElementById('map-canvas'),
     mapOptions);
 for (var city in citymap) {
   // Construct the circle for each value in citymap. We scale population by 20.
   var populationOptions = {
     strokeColor: '#FF0000',
     strokeOpacity: 0.8,
     strokeWeight: 2,
     fillColor: '#FF0000',
     fillOpacity: 0.35,
     map: map,
     center: citymap[city].center,
     radius: citymap[city].population / 20
   };
   cityCircle = new google.maps.Circle(populationOptions);
 }

}

google.maps.event.addDomListener(window, 'load', initialize);