var src = 'https://raw.githubusercontent.com/piterat/kmlLink/642e292853adc55d34f4105d94cb024fac104db4/NEWYORK_COUNTIES.kml'
var src1 = 'https://raw.githubusercontent.com/piterat/kmlLink/642e292853adc55d34f4105d94cb024fac104db4/NEWYORK_SNOWLOADS.kml';
var elevator;
//var infowindow = new google.maps.InfoWindow();
var map2;
var geocoder;
var marker;
var clickedLocation;
var NewYorkSnowLoads;
var lat;
var lng;
function newPopup4(url)
{
popupWindow = window.open(url,'popUpWindow','height=600,width=1100,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=no,menubar=yes,location=no,directories=no,status=yes')
}
function initialize()
{
geocoder = new google.maps.Geocoder();
var myLatlng = new google.maps.LatLng(42.80,-75.19);
var mapOptions =
{
zoom: 7,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map2 = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
// Create an ElevationService
elevator = new google.maps.ElevationService();
// Add a listener for the click event and call getElevation on that location
google.maps.event.addListener(map2, 'click', getElevation);
loadASCEdata();
}
function loadASCEdata()
{
NewYorkSnowLoads = new google.maps.KmlLayer(src1,{suppressInfoWindows: true,preserveViewport: true});
NewYorkSnowLoads.setMap(map2);
google.maps.event.addListener(NewYorkSnowLoads, 'click', function(kmlEvent)
{
if (marker != null)
{
marker.setMap(null);
}
var snowloadtext = kmlEvent.featureData.description;
var zone = kmlEvent.featureData.name;
clickedLocation = kmlEvent.latLng;
// Puts down marker at Clicked Location
marker = new google.maps.Marker({map: map2,position: clickedLocation,draggable: false});
getElevationData1(zone,snowloadtext);
});
}
function getElevation(event)
{
if (marker != null)
{
marker.setMap(null);
}
...
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.