JavaScript – Google Maps With Pointer

Google Map API is an interface for you to put maps on your webpage. It also can be used as an input method for a user to select his address exactly on a map. So, the user does not only type in his address, city, country and other location information as we can found generally on ordinary submit forms. They mark their exact address on the map. Sounds great, isn’t it? Google map API is generally used in real estates websites to provide a more informative and readable detail.


To move the marker, you may perform a single right click on a new location.

Source Code

        <title>Google Maps API Example</title>

            src="<your api key>"
            <your api key> is a unique key provided by google map
            You have to replace <your api key> with your api key
            You can get your API key at
        <div id="map" style="width:400px;height:400px"></div>
        To move the marker, you may perform a single right click
        on a new location.

        <script language="JavaScript">
            //By    : Xhanch Studio
            //URL   :

            var map;

            // Define default marker location
            var default_longitute = "-122.141944";
            var default_latitute = "37.441944";

            // Marker/Pointer moved handler
            function move_marker(latlng){
                    //Get the selected corrdinate
                    lng = latlng.lng();
                    lat =;

                    //Remove all markers

                    //Set new marker
                    var point = new GPoint(lng, lat);
                    var marker = new GMarker(point);

            // Google Map initialize
            if (GBrowserIsCompatible()) {
                map = new GMap(document.getElementById("map"));

                map.addControl(new GLargeMapControl());
                map.addControl(new GMapTypeControl());

                //Set default marker, the zoom we set to 7
                var point = new GPoint(default_longitute, default_latitute);
                var marker = new GMarker(point);

                // Assign a single right click event handle
                GEvent.addListener(map, "singlerightclick", function(point){
                    var latlng = map.fromContainerPixelToLatLng(point);

Incoming Search Terms

source code php right click and add marker place to google map, fromcontainerpixeltolatlng, gevent addlistener right click, google map pointer, google maps pointer, google pointer, gevent addlistener rightclick, google map php moving marker, javascript google map, javascript pointer map, google maps pointer javascript, google maps marker click singlerightclick, how to move the pointer in google maps, gevent addlistener(map rightclick, Google map with pointer, javascript google map location pointer, javascript pointers, javascript pointers for google maps, wordpress pointer api, right click google maps gevent, google maps with pointer, singlerightclick google maps, map pointer javascript, javascript google maps pointers, map pointer script, \singlerightclick\ point, logo pointer google maps, location pointer in google map in javasript, javascript search google maps, mouse right click in gmap in javascript, javascript goolge maps, javascript map single address, javascript mark point, javascript pointer google, latlng singlerightclick, javascript google maps, how to add google map pointer in java, how to add pointers in google maps, how to get a pointer on google, how to move the pointer of google maps, how to put a pointer on a map, how to put pointers on google Map, how to puy destination pointers on google maps, how to show maps with pointers in java script, how to show pointer in google map, i need to point 2 pointers on gmap one is source and other is destination using javascript, include google maps with pointers in website, java script for put pointer in google map, javascript code to search location in google map, green marker for source and destination google maps using javascript, javascript coding for displaying source and destination in google map, javascript for google maps, javascript for putting a map with markers on a webpage, how to add a pointer to google map api, map fromContainerPixelToLatLng, map fromcontainerpixeltolatlng in javascript, search as google maps in php javascript, script search point nya google map, script pointer google map javascript, right click on google map java script code, right click on google earth to put a marker, put pointer on google maps, put pointer on googl emap, put map with pointer on site, Search marker GEvent addListener, select javascript:marker click, wordpress google maps move pointer, wordpress google map customize pointer, ver pointer de google maps javascript, using the blue ball google maps api, url(#default-marker) javascript, singlerightclick google maps api, singlerightclick get latlng, singlerightclick, put a marker googlemaps javascript, pointer on gmap, mark a single address in google map api javascript, maps with pointers, map singlerightclick point, map singlerightclick, map pointer javascripy, singlerightclick get latitude, map fromcontainerpixeltolatlng(points) google maps, map fromContainerPixelToLatLng(point), mark point google maps, mark point on google maps javascript, POINTER GOOGLE MAPS API, pointer events javascript demo, php suburb location select script, php google map move marker, php google api pointers, move marker with google map api, marker pointer on google map, mark setinfo google maps, map pointer in javascript, google地圖 script, google map get location singlerightclick, gevent listener right click, GEvent addListener(marker singlerightclick function(), gevent addlistener(marker right clickt function(), Xhanch, Xhanch Studio

Posted on 2010-03-08 by Susanto BSc in Free Script, JavaScript
Javascript, Free, Code, Script, Map, Google Maps, Pointer, Google, Maps, Coordinate, Xhanch, Xhanch Studio

Tagged as: , , , , , , , , ,

2 Responses to “JavaScript – Google Maps With Pointer”

  1. tanvir says:

    Can i use this code commercially ?

    thank you

Leave a Reply

You must be logged in to post a comment.