Skip to content

Instantly share code, notes, and snippets.

View ffflabs's full-sized avatar

Felipe Figueroa ffflabs

View GitHub Profile
@ffflabs
ffflabs / README.md
Last active August 29, 2015 14:05
Styling unoptimized markers in Google Maps

Unoptimized markers exist as img elements inside the markerLayer mapPane.

(If your markers didn't had the optimized:false property, they will render inside a canvas element and won't be CCS stylable)

To get a reference to the markerLayer mapPane

  var myoverlay = new google.maps.OverlayView();
  myoverlay.draw = function () {
 //this assigns an id to the markerlayer Pane, so it can be referenced by CSS
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script>
function removeFile()
{
var input = document.getElementById("fileToUpload");
input.value = input.defaultValue;
refreshForm();
return false;
@ffflabs
ffflabs / README.md
Last active August 29, 2015 14:05
Toggle KML elements

Declare an array named kmlArray to store the kml layers. Toggle them using the corresponding marker index.

@ffflabs
ffflabs / README.md
Created October 30, 2014 01:52
Benchmarking Google Maps Marker creation

This example creates 2000 random coordinate pairs nearby San Francisco. You can use the buttons to print them using a synchronous loop or an asynchronous loop.

@ffflabs
ffflabs / index.html
Created November 15, 2014 02:36
associating buttons with map positions
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
@ffflabs
ffflabs / index.html
Created November 17, 2014 22:10
Appending place details to html element
<!DOCTYPE html>
<html>
<head>
<title>Place searches</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@ffflabs
ffflabs / index.html
Last active August 29, 2015 14:09
Change Google Maps location and zoom with a Select control
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style>
#map-canvas {
height:600px;
}
</style>
@ffflabs
ffflabs / index.html
Created November 24, 2014 12:08
Overlaying an SVG maker on top of Google Maps
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<style>
#map {
margin:20px auto;
@ffflabs
ffflabs / index.html
Created March 31, 2015 18:21
Clustering markers for a Redditor
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style>
#map-canvas {
height:500px;
}
</style>

jQuery vs WebWorker Request

The aim of this example is to show that, while jQuery will execute and resolve a bunch of request sequentially, delegating the task to webworkers will instead execute the request in parallel.

Be careful, this example will fire ~30 webworkers and may crash your browser.

The webworker is using pure javascript implementation of ajax request. jQuery kept throwing Cannot read property 'defaultView' of undefined error.