Skip to content

Instantly share code, notes, and snippets.

View juliaogris's full-sized avatar

Julia Ogris juliaogris

View GitHub Profile
@juliaogris
juliaogris / README.md
Last active October 19, 2019 03:49
Leaflet - Hello world!
@juliaogris
juliaogris / README.md
Last active August 29, 2015 14:09
GMaps JS API v3 - Hello World!
@juliaogris
juliaogris / README.md
Last active August 29, 2015 14:09 — forked from mbostock/.block
Google Maps and D3.js
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
@juliaogris
juliaogris / README.md
Last active August 29, 2015 14:16
Many markers

Many markers: Google Maps and Leaflet

@juliaogris
juliaogris / x.kml
Last active August 29, 2015 14:17
KML sample
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<GroundOverlay>
<name>panel1</name>
<Icon>
<href>panel1.png</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>37.5422476694301</north>
@juliaogris
juliaogris / poly.html
Last active August 29, 2015 14:24
Simple polyline
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polylines</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@juliaogris
juliaogris / index.html
Last active August 29, 2015 14:28 — forked from mikeurbach/example.html
Simple Google Map
<!DOCTYPE html>
<html>
<body>
<div id="map" style="position: absolute; width: 100%; height: 100%"></div>
<script type="text/javascript">
function init(){
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(37, -95),
zoom: 5
});
/**
* @param {!Array<!TileFactory>} factories
* @constructor
* @struct
* @final
* @implements {TileFactory}
*/
FallbackTileFactory = function(compositeFacotry, fallbackFactory, fallbackBounds) {
/** @override */
this.createTile = function(coord, zoom, size, div, opt_options) {

Smooth scroll to top of page

If you need a plain JavaScript function to add a smooth scrolling back to the top of the page, you can use this script.

  1. Add an id of "top" to the body
  2. Add the onclick function to the link
  3. Include the JavaScript function in your HTML file, preferrably at the bottom before the closing </body> tag if possible. Since this script is not part of the UI it can load last and will not negatively affect the user experience or usability of the page.

Author: Marco Del Corno - http://thewebthought.blogspot.com/2012/06/javascript-smooth-scroll-to-top-of-page.html