Google Maps API. Static Maps send an HTTP GET request receive an image (PNG, GIF, JPEG) no javascript needed encode params in URL example:

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

Java Script Session1 INTRODUCTION.
JQUERY/AJAX ALIREZA KHATAMIAN DELARAM YAZDANSEPAS.
The Web Warrior Guide to Web Design Technologies
Google Maps API. Today’s Objectives Get Google Maps working: desktop + mobile Get clustering data complete, data onto a map.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Point Mashups Peterson. Icons Info Marker Random Points.
CHAPTER 26 CREATING LOCATION-AWARE WEBPAGES USING GEOLOCATION.
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.
MCS 270 Spring 2014 Object-Oriented Software Development.
More APIs: Web Services CMPT 281. Announcements Project milestone Lab: – Web services examples.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
JavaScript & jQuery the missing manual Chapter 11
CS50 SECTION WEEK 9 Kenny Yu. Announcements  Problem Set 6 Returned.  Problem Set 8 Walkthrough up  Final Project’s Proposal due 11am Monday 11/14.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
GIS technologies and Web Mapping Services
Set 11: Mashups (emphasis on Google tools) IT452 Advanced Web and Internet Systems.
Programming Games Recap on Google Maps. Creating elements. Dynamic creation of elements (multiple video elements). Geolocation. Classwork/Homework: Catch-up.
Programming games Examples: Audio example. Google Maps api. Classwork: show more complex video. Classwork/Homework: Find place (lat and long) for basic.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
JavaScript Programming B.Ramamurthy 6/113/2014B. Ramamurthy CSE6511.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Programming Games Reprise: storage, datatypes. Geolocation/Google API example. Work session Homework: [Catch up. Upload work. Post proposal.] Work on your.
Session: 19. © Aptech Ltd. 2HTML5 Geolocation and APIs / Session 19  Explain geolocation and its use in HTML5  Explain the Google Maps API  Explain.
Introduction to JavaScript CS101 Introduction to Computing.
Dr. Martin Zhao Sept 4, Topics HTML and related tutorials on w3schools.com Related HTML tags Adding interesting features using JavaScript What is.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Static Locations, Dynamic Content.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
16 Map Layer Mashups Mapping in the Cloud Peterson.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
ArcGIS Server Overlays. The “REST” endpoint, v 9.3 or higher: …ArcGIS/rest/servicesArcGIS/rest/services.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
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.
CONTACTING OTHER SERVERS.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
GEOVISUALIZATION: VISUALIZE THAT ON A MAP Sarah G. Park April 14, 2016.
Part – 3 : HTML 5 SVG Tag. † SVG stands for Scalable Vector Graphics. † SVG is used to define vector-based graphics for the Web. † SVG defines the graphics.
1 Using the Google Maps JavaScript API. 2 The Google Maps APIs Permit web applications to use functionality of google maps. Documentation:
Point Maps Peterson’s Chapter 11 & 12. Points and Point Maps Points – Datum and coordinate systems – geocoding Point Maps – Show where points are (just.
Computer Basics Introduction CIS 109 Columbia College.
Creating Databases Example using Google Maps API + file creation. Dollar sign problem. Classwork/Homework: [catch up]. Work on final project.
Google Maps API. Contents: 1. Google Maps API Key 2. Create a Basic Google Map 3. Google Maps Overlays 4. Google Maps Events 5. Google Maps Controls 6.
1 Bus Tracker A Google Maps Application. 22 Objectives You will be able to Add an icon to a map created with the Google Maps API. Use Ajax techniques.
Java Script and the DOM DOM stands for: –The Document Object Model When a browser reads a web page, it converts it’s contents from HTML into a hierarchical.
Creating Databases Example using Google Maps API + file creation. Dollar sign problem. Classwork/Homework: [catch up]. Work on final project.
ISC440: Web Programming 2 Web APIs Google Maps API
Week 4: Introduction to Javascript
JavaScript is a programming language designed for Web pages.
AJAX – Asynchronous JavaScript and XML
Getting web pages First we need to get the webpage by issuing a HTTP request. The best option for this is the requests library that comes with Anaconda:
Google Maps: A Short How-to
DHTML Javascript Internet Technology.
A second look at JavaScript
Your 1st Programming Assignment
DHTML Javascript Internet Technology.
Introduction to JavaScript
Javascript and JQuery SRM DSC.
JavaScript Basics What is JavaScript?
Web Programming Anselm Spoerri PhD (MIT) Rutgers University
Introduction to JavaScript
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

Google Maps API

Static Maps send an HTTP GET request receive an image (PNG, GIF, JPEG) no javascript needed encode params in URL example: &param2=val2...

Static Maps embed using the "src" attribute of the tag. some parameters: – cetner: "lat,long" or "string address" – zoom, size, scale – path, markers – sensor

Static Maps om=14&size=512x512&maptype=roadmap &markers=color:blue%7Clabel:S%7C , &markers=color:green%7Clabel:G%7C , &markers=color:red%7Ccolor:red%7Clabel:C%7C , &sensor=false

Static Maps Documentation: ation/staticmaps/

Javscript API embed Google Maps in web pages. provides functions to manipulate maps free new: API key optional ntation/javascript/

Javscript API reference the API libraries in the embed the map canvas in the web page: <script type="text/javascript" src="

Loading the API Browser must load Maps API (js code) from Google. client code should not run until after the API has finished loading. e.g. if you call the API functions in initialize:

A Simple Map a map object takes an html element and an options object: var map = new google.maps.Map( document.getElementById("map_canvas"), myOptions );

A Simple Map myOptions is a JS object, specified using JSON: where location is a LatLng object: many more options are available var myOptions = { center: location, zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }; var location = new google.maps.LatLng(40.4, -79.9);

A Simple Map a LatLng object specifies a location: and the map type can be: – google.maps.MapTypeId.ROADMAP – google.maps.MapTypeId.TERRAIN – google.maps.MapTypeId.SATELLITE var location = new google.maps.LatLng(40.4, -79.9);

Create a Map full code listing: function initialize() { var location = new google.maps.LatLng(40.4, -79.9); var myOptions = { center: location, zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map( document.getElementById("map_canvas"), myOptions ); }

Placing Markers markers indicate points of interest marker options specify: location, icon, etc. set the marker using setMap() var options = { position: new google.maps.LatLng( , ) }; var marker = new google.maps.Marker(options); marker.setMap(map); // set the marker on the map

Interactive Maps you can add event handlers to the map: example: show the (lat,lng) when the user clicks on the map. function onMapClick(details) { alert(details.latLng); } // in the init function(): google.maps.event.addListener(map, 'click', onMapClick);

Street View function initialize() { var myOptions = { position: new google.maps.LatLng( , ), pov: { heading: 0.0, pitch: 20, zoom: 1 } }; var pano = new google.maps.StreetViewPanorama( document.getElementById('map_canvas'), myOptions); }

Geocoding & reverse Geocoding convert an address to (lat,lng) var geocoder = new google.maps.Geocoder(); var request = { address: "48 Pirrama Rd, Pyrmont" }; geocoder.geocode(request, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // center map on location... } else { // log error to console... } });

Not covered other things you can do: – animate markers – markers in street view – info windows – elevation – directions – shapes & lines