background preloader

Getting Started - Google Maps JavaScript API v3

Getting Started - Google Maps JavaScript API v3
The Maps JavaScript API lets you customize maps with your own content and imagery for display on web pages and mobile devices. The Maps JavaScript API features four basic map types (roadmap, satellite, hybrid, and terrain) which you can modify using layers and styles, controls and events, and various services and libraries. Audience This documentation is designed for people familiar with JavaScript programming and object-oriented programming concepts. You should also be familiar with Google Maps from a user's point of view. There are many JavaScript tutorials available on the Web. This conceptual documentation is designed to let you quickly start exploring and developing applications with the Maps JavaScript API. Hello, World The easiest way to start learning about the Maps JavaScript API is to see a simple example. View example. Even in this simple example, there are a few things to note: We declare the application as HTML5 using the <! These steps are explained below. Script Tag Attributes

Geocoding Service - Google Maps JavaScript API v3 Overview Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map. Reverse geocoding is the process of converting geographic coordinates into a human-readable address. The Google Maps API provides a geocoder class for geocoding and reverse geocoding dynamically from user input. When you first load the API, you will be allocated an initial quota of Geocoding requests. Once you have used this quota, additional requests will be rate-limited on a per-second basis. Geocoding Requests Accessing the Geocoding service is asynchronous, since the Google Maps API needs to make a call to an external server. You access the Google Maps API geocoding service within your code via the google.maps.Geocoder object. The GeocodeRequest object literal contains the following fields: These fields are explained below. Geocoding Responses

Map of the Week In this guest blog post, we hear from Adam Ratana, a hobbyist photographer and software engineer by day, and developer of the Android and iOS Sun Surveyor apps by night. In this tutorial, Adam talks about his creative implementation of custom polylines on Street View panoramas in the Google Maps SDK for iOS. When I set out to build Sun Surveyor, I knew I wanted to give users an easy way of visualizing the location of the sun and the moon. Visualizing the sun and moon paths in augmented reality and map views When Street View launched in the Google Maps SDK for iOS in v1.4.0 (July, 2013), I couldn’t wait to visualize the sun and moon paths within an interactive panorama. Sun and moon paths with Street View panoramas Implementing a sun path Overlay on Street View I took a creative approach to working with the Google Maps SDK for iOs. I. Representing Overlay Items We represent the overlay items with a protocol having two methods: updateWithPanoramaView and draw. II. III.

Google Maps API v3 tutorial - how to make a simple local business map I’ve grown a little tired recently of seeing the same old Google Maps embedded onto the contact webpage of small businesses. In this tutorial I’m going to walk through some of the basic features of the Google Maps API (V3) and create a custom map for a local business. I first tried out the Google Maps API when creating a mini map embed for our contact page. Dissatisfied with the clutter of the default Google Places embed, I managed to achieve a much more usable map whilst maintaining it’s mini size. The types of Map Embeds Available At present, there are three different ways to add Google Maps to your website. As you can see, particularly when used small, the classic map embed is barely usable. In this tutorial I’m going to explain the basics of creating your own local business Google Map embed using the API. This is not a complete tutorial to show you all of the possible features of the API, however I am going to cover the basics of creating your own map with a custom marker and controls.

Geocoding Service - Google Maps JavaScript API v3 Overview Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map. Reverse geocoding is the process of converting geographic coordinates into a human-readable address. The Google Maps API provides a geocoder class for geocoding and reverse geocoding dynamically from user input. Geocoding Requests Accessing the Geocoding service is asynchronous, since the Google Maps API needs to make a call to an external server. You access the Google Maps API geocoding service within your code via the google.maps.Geocoder object. The GeocodeRequest object literal contains the following fields: These fields are explained below. * Note: You may pass either an address or a latLng to lookup. The bounds and region parameters will only influence, not fully restrict, results from the geocoder. Geocoding Responses Geocoding Results

jquery_ui_map_v_3_sample_code - jquery-ui-map - Sample code - Google map v3 plugin for jQuery and jQuery Mobile Example constructor call Make the selected element a Google map. $('#map_canvas').gmap(); Map options are added in the constructor or set with the option method The map options is extended with a callback function which will execute when the Google Map object has been instanciated. When the map is fully initialized (with bounds) it will trigger the 'init' event. $('#map_canvas').gmap().bind('init', function(event, map) { // do something }); All properties in the MapOption object can be set and retrieved by Get the zoom var zoom = $('#map_canvas').gmap('option', 'zoom'); Set the zoom $('#map_canvas').gmap('option', 'zoom', 7); Example add custom control $('#map_canvas').gmap().bind('init', function() { $('#map_canvas').gmap('addControl', 'control', google.maps.ControlPosition.LEFT_TOP); }); $('#map_canvas').gmap('addControl', 'control', google.maps.ControlPosition.LEFT_TOP); Example add marker Example InfoWindow Close any open InfoWindow $('#map_canvas').gmap('closeInfoWindow'); Example JSON response

Getting Creative With the Google Maps API You’ve designed a shiny new website; carefully selecting the colors, typography and photographs to perfectly reflect the company's branding. Then your client asks you to add a map. Sure, you could use a map building ‘wizard’, such as the one that comes with every google account. But, let’s face it, their functionality is limited and they look pretty generic! The Google maps API, on the other hand, gives you the freedom to create completely customized maps, which can do all sorts of cool things. This series of tutorials will show you how to create customized maps using the Google maps API. The tutorials will cover all sorts of things. These tutorials use the scenario of a UK company promoting music festivals. Note: Only the Glastonbury marker is 'active' in this example. Before starting, you may like to download the files associated with this tutorial. An API, or Application Programming Interface, is a fancy way of saying a set of commands (e.g. functions) a company (e.g.

API Google Maps API Google Earth Webmapping Cartograhie exemples et tutoriels APIs Console Help The Google Developers Console is Google's developer experience for managing and viewing traffic data, authentication, and billing information for the Google APIs that your projects use. Managing projects in the Developers Console In the Google Developers Console, a project is a collection of settings, credentials, and metadata about the application or applications you're working on that make use of Google Developer APIs and Google Cloud resources. The Developers Console is where you manage these aspects of your project, such as generating API credentials, activating APIs, and managing team and billing information associated with your project. Creating and shutting down projects You can use one Developers Console project to manage all of your work, or you can create multiple projects, depending on your development and collaboration needs. Creating a project To create a project, do the following: Go to the Google Developers Console. Shutting down a project Restoring projects project owners . Chrome

Comment appeler une méthode d’un objet Javascript via setTimeout et setInterval ? | Epershand Pré-requis pour ce tutoriel Un navigateur web (Mozilla Firefox, Google Chrome, Safari aux choix)Un outil de développement (Coda, Dreamweaver, Aptana, Notepad++, etc.)Des bases en programmation Javascript Utilisation classique des fonctions setTimeout et setInterval En Javascript, les méthodes setTimeout(callback, timer) et setInterval(callback, timer) sont utilisées pour appeler une portion de code de manière décalée dans le temps. Voici comment ces deux fonctions s’utilisent : function myFunction() { alert('Hello world !') Utilisation dans un contexte objet Lorsque l’on développe en objet en Javascript, la donne change très sensiblement, ainsi si vous souhaitez utiliser les méthodes « setTimeout » ou « setInterval » vous aurez bien souvent tendance à vouloir écrire : setTimeout('this.myMethod()', 1000); Mais ce bout de code ne fera que générer un bug et n’appellera pas votre méthode. Cela revient à écrire : window.alert('Hi everybody'); De même si vous écrivez votre propre fonction :

How to Style Google Maps Google Maps is one of the best services you can get from Google. It’s a free tool that allows you to easily embed interactive and information-rich maps on your website. However, one disadvantage that comes from using free services is that eventually they all look the same. The good news is Google launched the API that controls the map styles. View Demo Google Maps Library The first thing that we need to do is to include the Google Maps JavaScript library inside the document’s <head> tag, so that we can use the API. Google Maps Components There are three components to style the Google Maps: the feautureTypes, the elementTypes, and the Sytlers. featureTypes is used to select the geographical objects on the map, such as the road, the water, and the parks, so it basically works like the CSS selectors. For more, you can head over to the following API reference: Google Maps feature type specification. stylers is an array of properties to adjust the object colors and its visibility. Basic Usage

Related: