Calculate Distance using Google Maps API

Calculate Distance on different location in the world by placing the  source and destination place in the below code while runing the below code.

This application using the Maps API to calculate the distance between two place. Below are the code to download and screenshot to display the output while running the application.

GMAP Distance

GMAP Distance

The Output will look like:
 

GMAP Output

GMAP Output

Advertisements

Google: Transliteration with Custom Control

With the AJAX Language API for Transliteration, you can enable transliteration on any textfield or textarea in you webpage. This will help your website users to type in any language using an English keyboard.

What is transliteration? Transliteration is the process of phonetically converting a word written in one script into another. Transliteration should not be confused with translation, which involves a change in language while preserving meaning. With transliteration, it is the sound of the words that are converted from one alphabet to the other.

This is an advanced example which shows how to create your own custom control to control the transliteration. It uses a checkbox for toggling between English and Hindi typing modes and a dropdown to change the destination language. It also registers event handlers for various events that can be raised by the Transliteration Control. See the API class reference for details on the possible events.

<html>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>

<script type=”text/javascript” src=”http://www.google.com/jsapi”></script&gt;

<script type=”text/javascript”>

// Load the Google Transliteration API

google.load(“elements”, “1”, {

packages: “transliteration”

});

var transliterationControl;

function onLoad() {

var options = {

sourceLanguage: ‘en’,

destinationLanguage: [‘ar’,’hi’,’kn’,’ml’,’ta’,’te’],

transliterationEnabled: true,

shortcutKey: ‘ctrl+g’

};

// Create an instance on TransliterationControl with the required

// options.

transliterationControl =

new google.elements.transliteration.TransliterationControl(options);

// Enable transliteration in the textfields with the given ids.

var ids = [ “transl1”, “transl2” ];

transliterationControl.makeTransliteratable(ids);

// Add the STATE_CHANGED event handler to correcly maintain the state

// of the checkbox.

transliterationControl.addEventListener(

google.elements.transliteration.TransliterationControl.EventType.STATE_CHANGED,

transliterateStateChangeHandler);

// Add the SERVER_UNREACHABLE event handler to display an error message

// if unable to reach the server.

transliterationControl.addEventListener(

google.elements.transliteration.TransliterationControl.EventType.SERVER_UNREACHABLE,

serverUnreachableHandler);

// Add the SERVER_REACHABLE event handler to remove the error message

// once the server becomes reachable.

transliterationControl.addEventListener(

google.elements.transliteration.TransliterationControl.EventType.SERVER_REACHABLE,

serverReachableHandler);

// Set the checkbox to the correct state.

document.getElementById(‘checkboxId’).checked =

transliterationControl.isTransliterationEnabled();

// Populate the language dropdown

var destinationLanguage =

transliterationControl.getLanguagePair().destinationLanguage;

var languageSelect = document.getElementById(‘languageDropDown’);

var supportedDestinationLanguages =

google.elements.transliteration.getDestinationLanguages(

google.elements.transliteration.LanguageCode.ENGLISH);

for (var lang in supportedDestinationLanguages) {

var opt = document.createElement(‘option’);

opt.text = lang;

opt.value = supportedDestinationLanguages[lang];

if (destinationLanguage == opt.value) {

opt.selected = true;

}

try {

languageSelect.add(opt, null);

} catch (ex) {

languageSelect.add(opt);

}

}

}

// Handler for STATE_CHANGED event which makes sure checkbox status

// reflects the transliteration enabled or disabled status.

function transliterateStateChangeHandler(e) {

document.getElementById(‘checkboxId’).checked = e.transliterationEnabled;

}

// Handler for checkbox’s click event.  Calls toggleTransliteration to toggle

// the transliteration state.

function checkboxClickHandler() {

transliterationControl.toggleTransliteration();

}

// Handler for dropdown option change event.  Calls setLanguagePair to

// set the new language.

function languageChangeHandler() {

var dropdown = document.getElementById(‘languageDropDown’);

transliterationControl.setLanguagePair(

google.elements.transliteration.LanguageCode.ENGLISH,

dropdown.options[dropdown.selectedIndex].value);

}

// SERVER_UNREACHABLE event handler which displays the error message.

function serverUnreachableHandler(e) {

document.getElementById(“errorDiv”).innerHTML =

“Transliteration Server unreachable”;

}

// SERVER_UNREACHABLE event handler which clears the error message.

function serverReachableHandler(e) {

document.getElementById(“errorDiv”).innerHTML = “”;

}

google.setOnLoadCallback(onLoad);

</script>

</head>

<body>


<center>Type in Indian languages (Press Ctrl+g to toggle between English and Hindi)</center>

<div id=’translControl’>

<input type=”checkbox” id=”checkboxId” onclick=”javascript:checkboxClickHandler()”></input>

Type in <select id=”languageDropDown” onchange=”javascript:languageChangeHandler()”></select>

</div>

<br>Title : <input type=’textbox’ id=”transl1″/>

<br>Body<br><textarea id=”transl2″ style=”width:600px;height:200px”></textarea>

<br><div id=”errorDiv”></div>

</body>

</html>

The demo on the Custom Transliteration can view on the below URL,

http://code.google.com/intl/ru/apis/ajaxlanguage/documentation/customtransliteration.html

Google Developer Day 2008

Logo

Logo

Google Developer Days are a chance to learn about Google developer products from the engineers who built them. These one-day events will include seminars and codelabs on web technologies including Google Maps, OpenSocial, Android, Gears, Google Web Toolkit and more.

Google Developer Day 2008 will focus on pushing the boundaries of web applications using Google developer technologies. Google engineers and web development leaders will lead you through one full day of in-depth Tech track sessions and hands-on codelabs on the latest Google technologies.

Google Developer Day 2008 is also about bringing brilliant developers together to share their own ideas. There is plenty of time to meet other developers, discuss ideas and share what you’ve been working on.

Sessions at Google Developer Day

Building Scalable Web Apps with Google App Engine

Speaker(s) – Rafe Kaplan

Type – Tech track

This session will commence with an introduction to Google App Engine followed by a discussion of how to design an app for maximum scalability.

For more information on the Google App Engine API please visit http://code.google.com/appengine

Getting started with Google App engine

Type – Codelab

Google App Engine allows you to quickly and easily develop web applications that scale effortlessly. We will walk you through setting up the SDK, writing a sample application in Python, and deploying and testing it on your local machine. We will demonstrate how to use the datastore, authenticate users and the other APIs that are available.

Infrastructure requirements

The codelab requires each participant to have a copy of Google App Engine SDK. Please click on the relevant link to download the SDK for your OS.

Windows

Mac

Linux

The participants should also have the latest version of python installed. Familiarity with Python is required.

SDK will also be given on a CD.

For more information on the Google App Engine API please visit http://code.google.com/appengine

Google Desktop Gadgets – Access, Share and Personalize Information

Speaker(s) – Rajesh Chandrashekaran

Type – Tech track

Provide an introduction to desktop gadgets running on google desktop, overview of the APIs, tools and incentives to create gadgets. The talk will also feature some hands-on demos and some cool videos of the more recent developments in this space.

For more information on the Google Desktop API please visit http://code.google.com/apis/desktop.

Building a desktop presence for your web site/web application

Type – Codelab

We will introduce ‘Desktop Gadgets’, a developer platform from Google, which provides web developers and websites an easy way to get a presence on the user’s desktop. Attendees will learn how desktop gadgets can work with their existing websites, provide additional features to the user and keep them engaged with their product. Also we will help to build an online/offline experience for their product and the developer tools available at their disposal.

Infrastructure requirements

Google desktop & SDK for desktop will be given on a CD.

For more information on the Google Desktop API please visit http://code.google.com/apis/desktop.

OpenSocial : A platform for the Social Web

Speaker(s) – Rajdeep Dua, Anash Oommen

Type – Tech track

This session would provide an introduction to OpenSocial, and also cover the need for a social platform for the web. It would also cover OpenSocial container related topics and an introduction to Shindig – an OpenSocial reference implementation.

For more information on the Google OpenSocial API please visit http://code.google.com/apis/opensocial.

Building OpenSocial compliant applications with OpenSocial APIs

Type – Codelab

In this session, you’ll build your first social app, set up a place to host your application to access the OpenSocial APIs. By the end of this session, you would have completed a series of OpenSocial Applications starting with accessing profile information, graduating to simple gift-giving applications.You will also get to write applications using OAuth and REST APIs. Base on your current level of expertise, this is what is in store for you:

Beginner: Building a get-friends and gift-giving OpenSocial gadget using javascript APIs
Intermediate: Using OAuth for authentication in a OpenSocial app.
Advanced: Using REST APIs to get access to the social graph.

For more information on the Google OpenSocial API please visit http://code.google.com/apis/opensocial.

The World is Not Flat: Building the Indian language Web

Speaker(s) – Rahul Roy Chowdhury, Anupama Dutta, Gokul Nath Babu Manoharan

Type – Tech track

This session will start with an overview of the Indian Language Market: what is the market opportunity, what are the major challenges, and why you should be examining how to tap into this huge emerging segment of users. We will then explore the Indic transliteration and translation API services that Google has recently introduced. We will describe the APIs and walk through how it can be used. We’ll provide several examples of actual usage long the way.

For more information on the Google Indic API please visit http://code.google.com/apis/ajaxlanguage/documentation.

A Richer Indic Language Website

Type – Codelab

In this session, we will start with a sample Indian language website and guide you through the usage of the existing Indic language APIs. We will use a combination of transliteration API which allows Indian language text to be typed in with ease, and the translation API for automated translation between English and Hindi. We will show how this site can be substantially enhanced through the use of these API’s and how it could open up entirely new customer segments for your business.

The later half of the session will be more open and free-form, where you can add one new innovative feature to the sample website using whatever combination of the available APIs. The more creative the better. Think about what will make for an interesting user experience.

Note: The person with the most creative feature implementation will win a special prize!

For more information on the Google Indic API please visit http://code.google.com/apis/ajaxlanguage/documentation.

Geo Web 2.0: Making local information truly local

Speaker(s) – Lalitesh Katragadda, Sanjay Jain

Type – Tech track

An in-depth map with local data is important for local commerce, tourism, investment and planning. Google is investing in India to get India on par with any developed country maps and local data. Bridging this information assymetry addresses needs of the community, local commerce and economic development. We will cover how the current Google Maps solution is spearheading this effort and how other organizations including businesses, NGOs and governments can leverage this to accelerate their own work.

For more information on the Google Maps API please visit http://code.google.com/apis/maps.

Building a Geo Web Application in two hours

Type – Codelab

The codelab will walk users through a scenario of how to build a simple maps mashup using the Google Maps API and then leverage the Google App Engine to build a stateful application where both application data and user data is stored in the App Engine and layered on to the mashup turning it into a full-fledged application. We will also show case use cases each for:

Business centric maps applications

NGO maps applications

For more information on the Google Maps API please visit http://code.google.com/apis/maps.

Google Web Toolkit: The Technical Advantage

Speaker(s) – Sumit Chandel, Anirudh Dewani

Type – Tech track

If you already heard about GWT, you probably know that it is a platform for building Ajax applications using the Java programming language. But what exactly does such a platform offer over other Ajax libraries, and more importantly, what does it mean for the web application developer and their projects? This session goes through the many benefits of the GWT platform, backed up by code samples and examples, and relates them to developers who build applications and the users who use them.

For more information on the Google Web Toolkit API please visit http://code.google.com/webtoolkit.

Photos

Ball Room

Ball Room

Reception

Reception

Reception

Reception

Reception

Reception

Presentation

Presentation

Presentation Hall

Presentation Hall

Presentation Hall

Presentation Hall

Presentation Hall

Presentation Hall

Session

Session

Session

Session

Googler

Googler

Thanks Giving

Thanks Giving