/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Always set the map height explicitly to define the size of the div element
* that contains the map.
*/
#map {
height: 100%;
display:none;
}
/*
* Optional: Makes the sample page fill the window.
*/
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
li{
display:none;
}
JavaScript
function reset(tablearea)
{
document.getElementById(tablearea).innerHTML = "";
var btn = document.getElementById('submitPincode');
btn.disabled = false;
document.getElementById("in").checked = false;
document.getElementById("us").checked = false;
document.getElementById('txtAddress').value = "";
}
function GetLocation() {
var btn = document.getElementById('submitPincode');
btn.disabled = true;
var geocoder = new google.maps.Geocoder();
var country="";
if(document.getElementById('in').checked == true) { country=document.getElementById('in').value;
} else {
country=document.getElementById('us').value;
}
var address = document.getElementById("txtAddress").value+","+country;
// var address = document.getElementById("txtAddress").value+",IN";
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latitude = results[0].geometry.location.lat();
longitude = results[0].geometry.location.lng();
console.log("Latitude: " + latitude + "\nLongitude: " + longitude);
initMap(latitude,longitude);
} else {
console.log("Request failed.")
}
});
};
function initMap(latitude,longitude) {
debugger
// Create the map.
console.log("Inside initMap");
console.log(latitude);
console.log(longitude);
const centreVar = { lat: latitude, lng: longitude };
const map = new google.maps.Map(document.getElementById("map"), {
center: centreVar,
zoom: 17,
mapId: "8d193001f940fde3",
});
// Create the places service.
const service = new google.maps.places.PlacesService(map);
let getNextPage;
const moreButton = document.getElementById("more");
moreButton.onclick = function () {
moreButton.disabled = true;
if...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.