Results 1 to 1 of 1
  1. #1
    Guest lilybluecat is an unknown quantity at this point
    Join Date
    2013 Jan
    Thanked 1 Time in 1 Post
    Rep Power

    How to use Google Map API for Maker Lat and Long

    How to use Google Map API for Maker Lat and Long!!

    1st you need to put this code in to your page

    <script type="text/javascript" src=""></script> 
    <script type="text/javascript"> 
          var map = null;
          var marker = null;
          var defaultLat = 13.75072;
          var defaultLng = 100.61004;
          var infowindow = new google.maps.InfoWindow(
               size: new google.maps.Size(150,50)
    function createMarker(latlng, name, html) {
        var contentString = html;
        var marker = new google.maps.Marker({
            position: latlng,
            map: map,
            zIndex: Math.round(*-100000)<<5
        google.maps.event.addListener(marker, 'click', function() {
        google.maps.event.trigger(marker, 'click');    
        return marker;
    function initialize() {
      // create the map
      var myOptions = {
        zoom: 10,
        center: new google.maps.LatLng(defaultLat,defaultLng),
        mapTypeControl: true,
        mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
        navigationControl: true,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      map = new google.maps.Map(document.getElementById("map_canvas"),
      google.maps.event.addListener(map, 'click', function() {
      google.maps.event.addListener(map, 'click', function(event) {
    	//call function to create marker
             if (marker) {
                marker = null;
    	 marker = createMarker(event.latLng, "name", "<b>Location</b><br>"+event.latLng);
    in scr="" put this with "http"+"://"+""

    2nd In BODY tag put even onload and call initialize() function

    HTML Code:
    <body onload="initialize()">
    3rd put this map object where do you want to place it

    HTML Code:
    <div id="map_canvas" style="width: 600px; height: 450px;"></div>
    Finish so easy right?

    if you want to get lat and long to insert into your database latlng

    use js script like this with variable latlng or latlng.lng()

    Thanks for reading. Sorry for bad english. I hope you dont mind.

    Any question post it!! I'll answer as soon as possible.

  2. The Following User Says Thank You to lilybluecat For This Useful Post:

Similar Threads

  1. [Tutorial] How to protect Rpg Maker [XP/VX/VXA] before Cheat Engine
    By Narzew in forum Anti-Cheat Systems
    Replies: 0
    Last Post: 2013-01-07, 09:16 AM
  2. Replies: 5
    Last Post: 2012-02-17, 02:06 PM
  3. Having a Long Pet name
    By ronmacam in forum Battle of the Immortals
    Replies: 0
    Last Post: 2011-05-03, 02:12 AM
  4. Agbot Script Maker
    By kazaam00nix in forum Silkroad Online
    Replies: 2
    Last Post: 2010-11-25, 11:29 AM
Visitors found this page by searching for:

macam macam maptypeid

macam-macam MapTypeId


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts