Home Answers Viewqa JavaScriptQuestions JavaScript google map API example.

 
 


ratna rathor
JavaScript google map API example.
1 Answer(s)      a year ago
Posted in : JavaScript Questions

How to Use Google Maps API in JavaScript?

View Answers

May 24, 2012 at 6:52 PM


Google Maps- A map is a way of representation of your route, location and many more things. As railway maps contain all railway routes, a road map shows you road, street information. In the same way google map works but in your desktop, laptop, mobile etc. It is web-based service. Google maps is a service, provided by Google.It is very powerful and user-friendly web mapping technology, which is used in different mapping field. It supplies Application Programming Interface (API) and navigational tool for street map, business location, route planner etc.

Google Maps API- Google Maps API is very useful in integrating Google Maps into websites. Google launched it in june2005. It is free service and can be used on any website by developer. Initially Google introduced JavaScript maps API.Here is one example-

<html>
<head>
<title>Google Maps API - Map Type</title>
<style type="text/css">
div#map {
    width: 100%;
    height: 1000px;
}
</style>
<script type="text/javascript"
    src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
    function loadGoogleMap() {
        var latlng = new google.maps.LatLng(28.70386, 77.11423);
        var mapOptions = {
            zoom : 13,
            center : latlng,
            mapTypeId : google.maps.MapTypeId.HYBRID,
            mapTypeControlOptions : {
                style : google.maps.MapTypeControlStyle.DROPDOWN_MENU,
                position : google.maps.ControlPosition.TOP_CENTER
            }
        };
        var map = new google.maps.Map(document.getElementById("map "),
                mapOptions);

        var marker = new google.maps.Marker( {
            position : latlng,
            map : map,
            title : "Roseindia Office!"
        });
}
</script>
</head>
<body onload="loadGoogleMap()">
<div id="map "></div>
</body>

</html>

Description: - This example loads the google map with defined latitude and longitude. src=http://maps.googleapis.com/maps/api/js?sensor=false this is google maps api ,including as JavaScript source. Here loadGoogleMap() is a function that is called on body load. latlng is variable and we are assigning new google.maps.LatLng(28.70386, 77.11423) that is some latitude and longitude value. It locates some specific location according to its value. Variable mapOptions holds all map type controls. MapTypeId. HYBRID holds map type HYBRID that shows a transparent layer of major streets on satellite images. Position and style is properties of mapTypeControlOptions. Marker defines the location you want to mark.









Related Pages:
JavaScript google map API example.
JavaScript google map API example.  How to Use Google Maps API in JavaScript?   Google Maps- A map is a way of representation of your route... map, business location, route planner etc. Google Maps API- Google Maps API
add google map javascript
add google map javascript  How can i add google map using javascript in my web page?   Search for the " Google Maps Javascript API" it will allow you to embed the Google Map into your web Page
Google Ajax API
Google Ajax API  Hi, What is Google Ajax API? From where I can get in our application. Thanks   Hi, Google AJAX APIs is a JavaScript... content on web pages. More details at Google Ajax API's page. Thanks
Google Map get Current Location on iphone and Android phones
Google Map get Current Location on iphone and Android phones  Hi, I am writing a simple javascript to get longitude and latitude for current location by using google API , but it works in my desktop browser but it doesn't
adding multiples markers to google map from a mysql database
" content="text/html; charset=utf-8"/> <title>Google Map API...adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes
adding multiples markers to google map from a mysql database
-type" content="text/html; charset=utf-8"/> <title>Google Map API V3...adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes
jsp maps api example - JSP-Servlet
jsp maps api example  Can u give a complete working example on usage of JSP GOOGLE MAP API
about google map
about google map  how to add google map in website
about google map
about google map  how to add google map in website
ApplicationDevelopment Using Google Map
ApplicationDevelopment Using Google Map  I want application using google map please guide me how can i develop
Google Map Integration - Ajax
Google Map Integration  Hi All, I am working on a vehicle tracking system project. I have to read data from sql server database and map the vehicle position in google map. I need to use ajax as the data is updated in every
adding multiples markers to google map from a mysql database
; Google Map API V3 with markers body { font: normal 10pt Helvetica...adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes
adding multiples markers to google map from a mysql database
; Google Map API V3 with markers body { font: normal 10pt Helvetica...adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes
Map
Map  If I have an object implementing the Map interface in Java and I... way of going through the map either iterator or for each loop or for loop   Here is an example of HashMap. import java.util.*; public class
Map
;Please visit the following links: HashTable Example ArrayList Example HashMAp Example
javascript and jquery not working in google chrome and firefox
javascript and jquery not working in google chrome and firefox  <...="text/javascript" src="http://goisearch.gov.in/content/scripts/jquery.1.8.7/jquery-1.4.4.js"></script> <script type="text/javascript" src="http
to make a google map point to user defined location
to make a google map point to user defined location  Hi, i wish to develop an google map,that takes the input from a form(city,area &Country... button, the form should be submitted and then the google map should display
google map with jsf - Java Server Faces Questions
google map with jsf  hi, i am using jsf with googlemap.i load the script file with googlemap .its working fine.how can i load the database values(latlong) to googlemap from jsf bean values.i want to show mutiple markers
progress bar in google map - Development process
progress bar in google map   in my google map i want a progress bar which should run when a button is clicked and should end when all the icons are loaded on the map.  Hi Nikhil, This is simple progress bar code
Google AJAXSLT
Google AJAXSLT       Google AJAXSLT is a Javascript framework for performing XSLT transformations, as well as XPath queries utilizes Backbase AJAX engine - cross browser compatible Read
Site map Index
| Site Map | Business Software Services India Web Services Tutorial ... SECTION     Java Tutorials | Java Code example | Java... | HTML | JavaScript | Questions? | Software Development Build &
Java Map Example
Description:- The above example demonstrates you the Map interface. Since Map...Java Map Example  How we can use Map in java collection?   The Map interface maps unique keys to value means it associate value to unique
Map code
Map code  hi................ I have map of navi mumbai, where i want to see the location vashi, nerul, turbhe.... means want to zoom into this area... as we see in google maps and locate our area of interest. Can u tel me how
license for google maps - iPhone SDK
license for google maps - iPhone SDK  Do i need a license to display the locations on google map in my iPhone application
Google maps GPS tracking
Now you can pinpoint your position with the aid of Google map that is now... exactly where you are in the map. Google did this because GPS enabled phone... loaded with Google Map and GPS technology, specially the smart phone
how to display the nearest palaces for the given latitude and longitude value in google map in android
how to display the nearest palaces for the given latitude and longitude value in google map in android  i m working in android. i need to display... in google map in android.. can any one help me
how to refresh google map using ajax by fetching lat long from database
how to refresh google map using ajax by fetching lat long from database ... the route travelled by it will be displayed on the google map by fetching the lat long from db. Now, i need to refresh the map using ajax.Pls help me how to do
hash map
int getI2(){ return i2; } } class Example{ public static void main...=2; HashMap<Integer,Test> map=new HashMap<Integer,Test>
Java Collection API - Java Tutorials
Java Collection API Collection was added to Java with J2SE 1.2 release.... Example : In the below example, the method "add" of Collection...(); System.out.println("Elements of set"); System.out.print("\t" + HS); Map HM = new
IP Locator
is a site based on the aiaxian google maps api, the user enters an Internet IP address to know the location of this ip in the global map. Enter the IP address... in the global map. Read full Description
Google Gadget Eclipse plugin
views:Google Calender, Google Talk, Google Map Allow user to customize... Google Gadget Eclipse plugin       Overview EGadget Plugin is ued to integrate any Google
Spring Map Example
Spring Map Example In this example you will see how bean is prepared for injecting Map collection type key and its values. MapBean.java...: Satya = 101 Rohit = 102 Aniket = 103 Download this example code
JavaScript array map
JavaScript array map      ... in understanding JavaScript array map. For this we are using a JavaScript language... and the document. write print the length of element. The Single variable map the singular
Google Adsense Tutorial
Google Adsense Tutorial     ... setup Google Adsense Account for your web site and start earning money from your... are good option for earning money from web site. Google Adsense is top program
J2me Map load error
J2me Map load error  Hi , i am making a POC to load google map in my mobile,now i m getting the address of location by its lattitude and longitude in web page , but thing is i wana to store in my net beans emulator , its showing
Java Map iterator with example
() method to get the data in Set object form. Java Map Iterator with Example... Java Map Iterator is an interface. It keeps the data in the key and value form. It is implemented by HashMap, Tree Map. Map has no iterator method. So
Javascript
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
Javascript and flex
Javascript and flex  Hi..... How do you call javascript from Flex? Give the right example. Thanks  Ans: Using the ExternalInterface API to access JavaScript from Flex. In flex application, you may have
Java Persistence API
Java Persistence API       Java Persistence API is the standard API used for the management of the persistent data and object/relational mapping. Java Persistence API is added in Java EE 5
Java Map Example
the key and values. Map.Entry defines both of these methods. Java Map Example...Map Interface adds keys to values. Every key in the Map Interface should be unique. It is part of java.util package. Each element in a map has a key
Site Map - All java tutorials
Site Map - All java tutorials In this section of sitemap we have listed..., Servlet, Hibernate, Ajax, JDBC, EJB, MySQL, JavaScript, Maven, Eclipse... Java AWT Package Examples Swing Example Java util
How to use Map in velocity
How to use Map in velocity       This Example shows you how to use map in velocity. The method...;map.put("libno", 1001);   list.add(map);   map 
Redirect to Google Search JSP
. To create a Google search on the web page we will use JSP. Example Here we will give an example of how to provide a google search on your web page... for example I have given "roseindia" then the Google search result
map
map  using map, i want display message based on id selected [both are strings]   i do no   Hi Friend, Try the following code...) { Map map=new HashMap(); map.put("Message1","Hello
Google Web Toolkit
Google Web Toolkit       Google Web Toolkit (GWT) is a Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't
Site map - C Tutorials
| Site Map | Business Software Services India Tutorial Section  ... Structure example | C Structure Pointer | C Temperature Converter | C... | C String Copy | C Dynamic Array | C file delete example | C file
Java Map Iterate
Map is an Interface in the Collection Framework. Map is implemented by its two sub classes HashMap Treemap Map has no iterator method. So use the entrySet() method.It returns the data as Set Example of Java Map
javascript
javascript  Hi deepak, sample example on javascript form validation   <html> <script> function checkName(text) { if(isNaN(text)){ return 1; } else{ alert("Please enter a valid name. The only charachters
On Javascript
fields, Example. to check for blank field, number validation for salary, mobile
Theming API
Theming API       Theming API You can edit or modify theme of widget... image depending on its parent container. For example, a ui-icon element

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.