﻿var Gmap = null;
var clickEvent = null;
var InitialLatitutde = 28.38;
var InitialLongitude = 77.17;
var pinOnMap = false;
var queryString;
// Demonstrate LoadMap, with a UI for trying out all of the parameters.

// This function loads the map

function GetMap() {

    var latLon = new VELatLong(InitialLatitutde, InitialLongitude);
    Gmap = new VEMap('myMap');
    Gmap.LoadMap(latLon, 4, 'r', false);
    //GetTiles(); // to call the wlltiles
    showFeaturedSites();
}



// the function adds pushpin if v click on the map at present not included in the map
function PixelClick(e) {

    var x = e.mapX;
    var y = e.mapY;
    pixel = new VEPixel(x, y);
    var LL = Gmap.PixelToLatLong(pixel);

    var pin = new VEPushpin(1,
              LL,
            'http://localhost/DHwithVE/image/pin.png',
             'My Pin',
          'Text that describes my pin'
               );

    Gmap.AddPushpin(pin);
    pinOnMap = true;

}

function DisposeMap() {
    if (Gmap != null) {
        Gmap.Dispose();
    }
}

/*****************************************************
v-aditsa: Zoom to street and city levels
*****************************************************/

function ZoomStreetLevel(lat, lon) {
    Gmap.SetCenterAndZoom(new VELatLong(lat, lon), 16);
}

function ZoomCityLevel(lat, lon) {
    Gmap.SetCenterAndZoom(new VELatLong(lat, lon), 13);
}

function ZoomRegionLevel(lat, lon) {
    Gmap.SetCenterAndZoom(new VELatLong(lat, lon), 7);
}

function ZoomNLevel(lat, lon, n) {
    Gmap.SetCenterAndZoom(new VELatLong(lat, lon), n);
}