• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Google Maps Loader (gallery-google-maps-loader) on cdn

    Last Updated: 09/3/12
    + 0 -

    Steven Olmsted

    YUI Contributor

    See 42 more by this user.

    Created: 03/7/11
    Last CDN Push: 09/5/12
    Build Tag: gallery-2012.09.05-20-01
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.5.1
    Free for use.

    Google Maps Loader is a JSONP wrapper for loading the Google Maps Javascript API. It provides a simple interface for loading extra libraries, localization, and versioning.

    This module has recently been updated with API changes. Y.GoogleMapsLoader is now a regular class extending Base instead of a singleton instance.

    • Tags:
    • solmsted
    • jsonp
    • loader
    • maps
    • google
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Y.GoogleMapsLoader has two public attributes.
    source: the location of the Google Maps Javascript API. Defaults to 'http://maps.google.com/maps/api/js'
    timeout: the timeout used by JSONP. Defaults to 30 seconds.

    Y.GoogleMapsLoader has three public events.
    failure: fired when JSONP fails to load the Google Maps Javascript API.
    success: fireOnce: fired when the Google Maps Javascript API is loaded.
    timeout: fired when JSONP times out.

    Y.GoogleMapsLoader has two public methods.
    isLoaded: returns boolean.
    load: loads the Google Maps Javascript API. (Does nothing if already loaded.)

    The load method accepts an optional parameters object. The parameters object may include any of these optional members.

    client: This is your client id when using Google Maps API for Business
    key: This is your Google Maps v3 API key.
    language: the language code to override the browser's default language.
    libraries: an array or comma separated list of library names.
    region: a Unicode region subtag identifier to override the default region.
    sensor: set this to true if your application determines the user's location via a sensor .
    source: location of the Google Maps Javascript API to override the attribute.
    timeout: timeout in milliseconds to override the attribute.
    version: the version of the Google Maps Javascript API to load.

    Code Sample

    <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2012.09.05-20-01'
    }).use('gallery-google-maps-loader', 'node', function (Y) {
        new Y.GoogleMapsLoader().load({
            language: 'ja',
            libraries: [
                'adsense',
                'geometry'
            ],
            region: 'ES',
            sensor: false,
            version: '3.4'
        }).on('success', function () {
            new google.maps.Map(Y.Node.getDOMNode(Y.one('#map')), {
              zoom: 1,
              center: new google.maps.LatLng(0, 0),
              mapTypeId: google.maps.MapTypeId.ROADMAP
            });
        });
    });

    Forum Posts

    No forum posts for this module.

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info