Beruflich Dokumente
Kultur Dokumente
Gateway to the Geoweb Geoweb Attack of the NeoGeos Interface To Google Maps for Application Developers JavaScript Library Simple, quick deployment Provides Geocoder (Version 2)
Implementation of AJAX/DHTML
Key good for a single directory on server and all sub directoriesusually a host usually Typically looks like
http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAS hF...
Trick
V=2 Current 2.77 V=2.xLatest 2.88 V=2.77Fixed to specific version Fixed
Limit of 50,000 geocode requests per day Does not include advertising YET!!! Must be available to the public
Cant alter Google Logos on images They can upgrade of change library at anytime
GMap2 class
An instance of GMap2 represents a single map on the page. You can create as many instances of this class as you want (one for each map on the page).
XML, JSON, REST API Not AJAX 3rd Party Some other work arounds>>Not Native >>Not Really just XML Parsing
WMS
Markers
GLatLng argument
var point = new GLatLng(43.65654,-79.90138); 79.90138); var marker = new GMarker(point); map.addOverlay(marker);
USGS GIS Workshop 2008
GPolygon(points, strokeColor strokeWeight?, strokeColor?, strokeOpacity?, fillColor?, fillOpacity fillOpacity?) GPolyline(points, color?, weight?, opacity?) (points, IE Requires VML Namespace
<html xmlns="http://www.w3.org/1999/xhtml" ="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml com:vml"> var pl = new GPolyline([new GPoint(-107.395492, 42.893307 107.395492, 42.893307), new GPoint(-107.398249, 42.891117)], 107.398249, "#EC4F18", 4, 1); map.addOverlay(pl);
InfoWindows
Regular or Tabbed HTML or DOM Stand Alone of Event Driven Bind to any feature (map, marker)
#2 openInfoWindowHTML(HTML content)
marker.openInfoWindowHtml("Marker #<b>" + number + "</b>"); ("Marker
var infoTabs = new GInfoWindowTab("Tab #1", "This is tab #1 content"); ("Tab marker.openInfoWindowTabsHtml(infoTabs infoTabs);
Adds behaviors based on user interactions Application listens for things to happen GEvent.addListerner (map object, event, the Function to perform)
var map = new GMap2(document.getElementById document.getElementById("map")); GEvent.addListener(map, "click", function() { (map, alert("You clicked the map."); }); OR GEvent.addListener(marker, "click", function() { (marker, marker.openInfoWindowHtml(<b>Hello World</b>); (<b>Hello });
USGS GIS Workshop 2008
Gmap Events
Gmap Events
AJAX has been around, made popular by Google (maps.google.com) AJAX no a language, technique using a variety of technologies (DOM, DHTML, Javascript, XML). , XMLHTTPRequest Javascript Object Allows data to be requested from server without page reloads Client Side Browser Independent (with a little help) Better user experience More desktop like Asynchronous
Source:Crane,etal.2006
AJAX has been around, made popular by Google (maps.google.com) AJAX no a language, technique using a variety of technologies (DOM, DHTML, Javascript, XML). , XMLHTTPRequest Javascript Object Allows data to be requested from server without page reloads Client Side Browser Independent (with a little help) Better user experience More desktop like Asynchronous
Source:Crane,etal.2006
GDownloadURL
Function(data,responseCode)
n
Where response code is HTTP response code from server Usually 200 if successful
GDownloadUrl("example.xml", function(data, responseCode) { ("example.xml", if (responseCode == 0){ var xml = GXml.parse GXml.parse(data); . Parse Data using DOM. map.addOverlay(marker)); (marker)); } });
More like XMLHttpRequest Object Able to check the state of the request little better
IE cannot overlay when rendered locally Firefox will Browser security requires data resources and the resulting webpage be resolved to same hostname
Kind
of
getElementsByTagName () returns all DOM nodes as array getAttribute() returns value of specified attribute for a particular DOM node parseFloat(string)parse a string into float parse
var markers = xml.documentElement.getElementsByTagName xml.documentElement.getElementsByTagName("marker") for (var i = 0; i < markers.length; i++) { var point = new GLatLng(parseFloat parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); parseFloat map.addOverlay(new Gmarker(point)); (point)); }
REST: More of a philosophy than a technology Simply and Elegant Web Service Architecture URI based web service access Javascript Security
Mashup
Mashup Resources
Clearly defined using standard policies, practices, and frameworks Clearly described (xml) Autonomous Abstractions of the underlying business logic and functionality
n
Easy to understand: one party delivers a service according to a contract with the other party REST, SOAP, WMS, WFS, ArcXML Images, Generic XML, KML, GeoRSS GML, etc GeoRSS,
Source: ArcIMSWMSConnectorHelp
Protocols
Encodings
WMS
support of the creation and display of registered and superimposed map-like views of information that come like simultaneously from multiple remote and heterogeneous sources Geospatial data response encoded as image Version 1.3 Developed as part of the Web Mapping Testbed project (WMT)
Source:King2006
WMS
Any WMS client can access maps from 1 or many servers Any client can combine maps (overlay as acetate layers) Any client can query information from any server Implements 3 functions
getCapabilities What does the service support getMap get me the map getFeatureInfo query and identify
Source: ArcIMSWMSConnectorHelp
Varied mean so doing so Primary Google Maps Functions and Interfaces and Constants
WMS getMap URL n Service Name var layer1=[G_HYBRID_MAP.getTileLayers()[0], myDOQQLayer]; ()[0], n Format
n
Not good use of xml because includes a lot of formatting issues, not just data structure (My Opinion) Default xml specification for Globe Services Huge specification Tools and authoring KML
ArcMap Script -- http://arcscripts.esri.com/details.asp?dbid=14273 Arc2Earth -- http://www.arc2earth.com/ Xtools ArcToolbox Renders (ArcGIS Server, Geoserver, POSTGIS) ,
GeoRSS
RSS 2.0 and ATOM 1.0 Other terms: Podcast, News Feed, etc Integrated into new browsers but can also use aggregators
KML 2.0 and GeoRSS but more in the future Easy and quick Creates new GOverlay Object KML 2.0 Only GeoRSS Simple, W3C, GML Cant be local (this means not exercise) Caching on Google Server
n
Pitfalls
Minimal Control
n
References
Crane, D., Pacarello, E. (2006). Ajax in Action. Manning Publications , Company. King, JJ. SOA What? Introduction to Service Oriented Architecture. Rocky Mountain Oracle Users Group. Denver, 2006. Gibson, R., and Erle, Schuyler. (2006). Google Maps Hacks: Tips and Tools , for Geographic Searching and Remixing. OReily.
Web Resources
API Homehttp://www.google.com/apis/maps/documentation http://www.google.com/apis/maps/documentation API Bloghttp://googlemapsapi.blogspot.com/ http://googlemapsapi.blogspot.com/ API Discussion Forumhttp://groups.google.com/group/Google http://groups.google.com/group/Google-Maps-API Google Maps API Change Log http://groups.google.com/group/Google-Maps-API/web/api-versionhttp://groups.google.com/group/Google changes?version=10 Google Maps Tutorial -- http://econym.googlepages.com/ Gmaps Sample -- http://gmapssamples.googlecode.com/svn/trunk/gdownloadurl_new/async_explain.htm ArcIMS WMS Connector Help -http://webhelp.esri.com/arcims/9.2/general/ WMS Javascript Library -- http://johndeck.blogspot.com/
Introduction to the Google Maps API: By Gregory L. Gunther