Skip to content

Instantly share code, notes, and snippets.

@takempf
Forked from devennorton/markup.html
Created May 9, 2013 05:02

Revisions

  1. @devennorton devennorton revised this gist Apr 30, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ var transactions = [];

    function randomPolyOpts(){
    return {
    fillColor: '0,0,' + Math.floor(Math.random()*3)*127,
    fillOpacity: 1
    fillColor: '#' + Math.floor(Math.random()*16777216).toString(16),
    fillOpacity: Math.random()
    }
    }

    @@ -69,8 +69,8 @@ function initialize() {
    });
    layer.setMap(map);

    window.setInterval(goWild(), 1000);
    window.setInterval(dropPoint(), 120);
    window.setInterval(goWild, 3000);
    window.setInterval(dropPoint, 2400);
    }

    google.maps.event.addDomListener(window, 'load', initialize);
  2. @devennorton devennorton revised this gist Apr 30, 2013. 1 changed file with 2 additions and 8 deletions.
    10 changes: 2 additions & 8 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -68,14 +68,8 @@ function initialize() {
    }]
    });
    layer.setMap(map);
    console.log("hello.");
    transactions.push(new google.maps.Marker ({
    position: new google.maps.LatLng(Math.random()*360-180, Math.random()*360-180),
    map: map,
    title: "TRANSACTION"
    }));

    //window.setInterval(goWild(), 1000);

    window.setInterval(goWild(), 1000);
    window.setInterval(dropPoint(), 120);
    }

  3. @devennorton devennorton revised this gist Apr 30, 2013. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -68,6 +68,12 @@ function initialize() {
    }]
    });
    layer.setMap(map);
    console.log("hello.");
    transactions.push(new google.maps.Marker ({
    position: new google.maps.LatLng(Math.random()*360-180, Math.random()*360-180),
    map: map,
    title: "TRANSACTION"
    }));

    //window.setInterval(goWild(), 1000);
    window.setInterval(dropPoint(), 120);
  4. @devennorton devennorton revised this gist Apr 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion script.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    var map, layer;
    var countries = ['RS', 'AL', 'DZ', 'AO', 'AG', 'AR', 'AM', 'AU'];
    var transactions = array();
    var transactions = [];

    function randomPolyOpts(){
    return {
  5. @devennorton devennorton revised this gist Apr 30, 2013. No changes.
  6. @devennorton devennorton revised this gist Apr 30, 2013. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion script.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    var map, layer;
    var countries = ['RS', 'AL', 'DZ', 'AO', 'AG', 'AR', 'AM', 'AU'];
    var transactions = array();

    function randomPolyOpts(){
    return {
    @@ -18,6 +19,14 @@ function goWild(){
    console.log('wildly wild');
    }

    function dropPoint(){
    transactions.push(new google.maps.Marker ({
    position: new google.maps.LatLng(Math.random()*360-180, Math.random()*360-180),
    map: map,
    title: "TRANSACTION"
    }));
    }

    function initialize() {

    //var australia = new google.maps.LatLng(-25, 133);
    @@ -60,7 +69,8 @@ function initialize() {
    });
    layer.setMap(map);

    //window.setInterval(goWild(), 1000)
    //window.setInterval(goWild(), 1000);
    window.setInterval(dropPoint(), 120);
    }

    google.maps.event.addDomListener(window, 'load', initialize);
  7. @devennorton devennorton created this gist Apr 30, 2013.
    13 changes: 13 additions & 0 deletions markup.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <!DOCTYPE html>
    <html>
    <head>
    <title>Boku in Heat</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Fusion Tables styling</title>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCu0KqDrN-FYvzwTCzec_EakWQlcPeoPC8&sensor=false"></script>
    </head>
    <body>
    <div id="map-canvas"></div>
    </body>
    </html>
    66 changes: 66 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    var map, layer;
    var countries = ['RS', 'AL', 'DZ', 'AO', 'AG', 'AR', 'AM', 'AU'];

    function randomPolyOpts(){
    return {
    fillColor: '0,0,' + Math.floor(Math.random()*3)*127,
    fillOpacity: 1
    }
    }

    function goWild(){
    var style = [{polygonOptions: { fillColor: '#333333', fillOpacity: 0.2}}];
    for (var i = countries.length - 1; i >= 0; i--) {
    style.push({polygonOptions: randomPolyOpts(), where: "'ISO 2 Letter Code' = '" + countries[i] + "'"});
    };
    layer.styles = style;
    layer.setMap(map);
    console.log('wildly wild');
    }

    function initialize() {

    //var australia = new google.maps.LatLng(-25, 133);

    map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: new google.maps.LatLng(0, 0),
    zoom: 2,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    layer = new google.maps.FusionTablesLayer({
    query: {
    select: 'Geometry',
    from: '1-05stFIyjdScUWHcaVr7u6JVDh3SamBIA4rMguc'
    },
    styles: [{
    polygonOptions: {
    fillColor: '#333333',
    fillOpacity: 0.2
    }
    }, {
    where: "'ISO 2 Letter Code' = 'US'",
    polygonOptions: {
    fillColor: '#008888',
    fillOpacity: 0.5
    }
    }, {
    where: "'ISO 2 Letter Code' = 'GB'",
    polygonOptions: {
    fillColor: '#00FF00',
    fillOpacity: 0.5
    }
    }, {
    where: "'ISO 2 Letter Code' = 'RU'",
    polygonOptions: {
    fillColor: '#FF0000',
    fillOpacity: 0.5
    }
    }]
    });
    layer.setMap(map);

    //window.setInterval(goWild(), 1000)
    }

    google.maps.event.addDomListener(window, 'load', initialize);
    3 changes: 3 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    html { height: 100% }
    body { height: 100%;}
    #map-canvas { height: 800px; width: 100%; padding-right: -100px }