Google Maps: A Short How-to

Slides:



Advertisements
Similar presentations
PART IV - EMBED VIDEO, AUDIO, AND DOCUMENTS. Find a video on Youtube.com: Search for a video, then look for the Embed code. Copy this code into the HTML/JavaScript.
Advertisements

Mash-it-up Google Style Put your data on the Map.
JavaScript 101 Lesson 01: Writing Your First JavaScript.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
ETT 429 Spring 2007 Web Design I.
11 Using the Google Maps API. 2 Objectives You will be able to Use the Google Maps API to display a map of any location on an HTML page. Programatically.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
Writing All Your Code In OpenEdge Architect Peter van Dam.
BY LINDA MOHAISEN MIKE ZIELINSKI The Tree Census Project.
Making an HTML Document Notepad Group Bo Kim Dan Carter Han Chong Justin Weaver Kris Lamont.
INFSCI  Last time we built a doggie web page in class following the instructions in the slide deck: Build Web Page with HTML – see week 3 The topics.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Google Maps API. Static Maps send an HTTP GET request receive an image (PNG, GIF, JPEG) no javascript needed encode params in URL example:
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Introduction to HTML. What is a HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup tags  The.
Programming Games Google Map API examples. CSS. Classwork/homework: Catch up. Upload work. Show your [more] complex Google Maps API example. Plan your.
Web Programming Basics of HTML. HTML stands for Hyper Text Mark-up Language A mark-up language is different than those that you have learned before in.
Getting Started with HTML Please use speaker notes for additional information!
Tutorial: Using ArcGIS Server and ESRI ArcGIS API for Javascript Peter Sforza March 7, 2013.
SAN DIEGO SUPERCOMPUTER CENTER Inca Data Display (data consumers) Shava Smallen Inca Workshop September 5, 2008.
PROCESSED RADAR DATA INTEGRATION WITH SOCIAL NETWORKING SITES FOR POLAR EDUCATION Jeffrey A. Wood April 19, 2010 A Thesis submitted to the Graduate Faculty.
Google APIs Why Aren’t You Using Them? Jeff Blankenburg Project Engineer Quick Solutions, Inc.
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
JavaScript - A Web Script Language Fred Durao
Chapter 2 Web Page Design Mr. Gironda. Elements of a Web Page These are things that most web pages use.
Introduction to Client Side Scripting CS Client Side Scripting Client side means the Browser is interpreting the script Script is downloaded with.
Bloomington’s Online Resources for Public Communication Laura Haley GIS Manager Information & Technology Services (ITS) City of Bloomington.
HTML ( HYPER TEXT MARK UP LANGUAGE ). What is HTML HTML describes the content and format of web pages using tags. Ex. Title Tag: A title It’s the job.
TerraFly Project High Performance Database Research CenterHigh Performance Database Research Center NASA Regional Applications CenterNASA Regional Applications.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. HTML5 Evolving Standards JavaScript.
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
Advanced DOM Builds on last presentation on DOM Allows you to dynamically create elements and position them on a page DOM methods/properties are W3C standard.
AGB 3/26/121 ++=. 2 Yes, believe it or not this is a complete webpage. It has a Head, Title and Body between the start and end HTML Tag.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Implementation of Google Map in Drupal Create in Miyula Zeng, XiaoHang Zou,
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Google Map API The Google Maps API lets you embed Google Maps in your own web pages with JavaScript The API provides a number of utilities for manipulating.
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
Functions Wouldn’t it be nice to be able to bring up a new animal and paragraph without having to reload the page each time? We can! We can place the.
HTML Help book. HTML HTML is the programming language used to make web pages for the Internet. HTML stands for Hyper Text Markup Language. HTML is made.
Source of website: “Text/css rel=“styles heet” This is an external style sheet link. This means that the.
1 Using the Google Maps JavaScript API. 2 The Google Maps APIs Permit web applications to use functionality of google maps. Documentation:
GIS, Maps & Mapping Mashups
Rep change 1590 (ver 18) Access to Google books
Web Services application that operates over a network
>> Introduction to CSS
Uppingham Community College
JavaScript Event Handling.
Javascript Short Introduction By Thanawat Varintree,
Introduction to JavaScript
JavaScript.
GIS, Maps & Mapping Mashups
A guide to HTML.
JavaScript: Array, Loop, Data File
DHTML Javascript Internet Technology.
Your 1st Programming Assignment
Introduction to DOM.
Basic HTML and Embed Codes
DHTML Javascript Internet Technology.
JavaScript Programming Labs
HTML Links.
Lesson 11: Web Services and API's
HTML Structure.
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Tutorial 10: Programming with javascript
Type your presentation title here
Introduction to JavaScript
Week 5: Recap and Portfolio Site
Presentation transcript:

Google Maps: A Short How-to

First things first... Need an API key from Google Sign up at www.google.com/apis/maps Must have a Google account

How does it work? Javascript embedded in webpages Dangers of Javascript: It will let you do anything! No variable typing var x = 6; x + 4 => 10 x + “xyz” => “6xyz” Hard to debug

In your code... 1. Collect location data 2. Output an HTML page with embedded Javascript 3. Launch a web browser from Jython and load your new webpage import os.system os.system(“/usr/bin/firefox http://www.google.com”)

Basic HTML code Basic file structure <html> <head> title, meta information </head> <body> main html code goes here javascript with Google Map </body> </html>

Step by step example – page 1 Key goes in header of HTML file <html> <head> <script src="http://maps.google.com/maps?file=api&v=1&key=YOUR.KEY.HERE" type="text/javascript"></script> </head>

Step by step example – page 2 In the body of the code, set width and height of map and add Javascript <html> . <body> <div id="map" style="width: 80%; height: 100%"> </div> <script type="text/javascript"> YOUR SCRIPT HERE </script> </body> </html>

Creating a map <script type=”text/javascript”> // Create new map var map = new Gmap(document.getElementById("map")); // add a zooming control to the map map.addControl(new GSmallMapControl()); // center the map on atlanta (lat/long) and set level // of zoom map.centerAndZoom(new GPoint(-84.3891,33.7534), 8); // add control for scale (eg 1 cm = 1 mile) map.addControl(new GScaleControl()); // then we can put things on the map! </script>

Creating points on your new map: // Function: createMarker // input: latitude coord, longitude coord, name // output: marker added to map with EventListener for click on icon function createMarker(lat,lon,id) { var point = new GPoint(lat,lon); var marker = new GMarker(point); map.addOverlay(marker); // note HTML formatting of text var txt = "<b>" + id + "</b>"; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(txt); }); } // let's create three points! createMarker(-84.5530,33.8161, "Valh"); createMarker(-83.8738,33.9712, "Keith"); createMarker(-83.8786,34.2704, "user6");

Hints Go slow! Reload often! Be careful with Javascript! Incremental steps Reload often! Be careful with Javascript!

Fun extras Create different icons / incorporate pics Tie into other Google APIs Google Local Driving Directions Points of interest within X miles Froogle Google Earth

Resources Beginner tutorial: www.econym.demon.co.uk/googlemaps/ Discussion forums: groups.google.com/group/Google-Maps-API Map Wiki: www.mapki.com/index.php?title=Main_Page (Good examples under 'Map Projects' in sidebar)