Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions JavaScript google map API example.

Have Programming Question? Ask it here!
 
 
 


ratna rathor
JavaScript google map API example.
1 Answer(s)      2 years and 2 months ago
Posted in : JavaScript Questions


How to Use Google Maps API in JavaScript?


Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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
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
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 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
jsp maps api example - JSP-Servlet
jsp maps api example  Can u give a complete working example on usage of JSP GOOGLE MAP API
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
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
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
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
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  how to send data from mysql database to google chart api using java
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
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  Добовляйтесь в группу "МАЙНКРАФТА" Будьте участниками Группы Помогаите нам и себе Наша группа https://vk.com/club60851464 Есть свой сервер! Хорошая атмосфера
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
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
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
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
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
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
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
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
Map
;Please visit the following links: HashTable Example ArrayList Example HashMAp Example
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
Event listener in JavaScript with example
Event listener in JavaScript with example  What is event listener in JavaScript? Can anyone please post an example of Event listener?? Thanks in Advance
Example of getDocType method in DOM API.
getDocType() Example in DOM API In this section, we will discuss about the implementation of the getDocType() method. This method checks that DTD(Document...       DTD provided Download The Example
javascript recursion example
javascript recursion example   javascript recursion example   <html> <script> function factorial (n) { if(n==0) return(1); return (n * factorial (n-1) ); } document.write(factorial(5)); <
API
API  what means API in java?   Hi Friend, The Application Programming Interface (API) is a library of functions that allow programmers... for building software applications in java. If you want to know about java api, please
api
api  WHAT IS THE DEFINITON OF API,EXPLAIN IN DETAIL?   An API is the interface implemented by an application which allows other... of it by a computer program. An API differs from an application binary interface
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
Tree Map Example
Tree Map Example     ...(String[] args) { System.out.println("Tree Map Example!\n"); TreeMap <... the tree map contain: " + tMap.values()); } } Download this example
Example of getTagName() method in xml dom api.
Example of getTagName() method. In This Example, we implement the method... the element. In this example, we create the Dom parser by create the instance...] the output of getTagName = order Download The Example
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
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 
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
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
Google Search
Google Search  I have a textbox and submit button in my JSP page. On giving word in the textbox and click submit it should redirct to google search page and fetch all the results based on my input word automatically. JSP/Servlet
Map interface
Map interface  What is the Map interface
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
Hash Map
Hash Map  how to add the hash map objects in the list and iterate the objects
hash map
int getI2(){ return i2; } } class Example{ public static void main...=2; HashMap<Integer,Test> map=new HashMap<Integer,Test>
Interactive map
Interactive map  hi........ i require map to be zoom in and enlarge the area and show its detail. Can anyone tel me how can this be done using java swings .... plz help
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
 

 

 

DMCA.com