Click here to Skip to main content
15,076,130 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
can we implement google maps on windows form if s pls provide me the needfull articals
Posted
Comments
ZurdoDev 9-Feb-15 14:27pm
   
Have you searched for samples on google?
durgesh j 9-Feb-15 15:41pm
   
also want to show heat maps for different countries

1 solution

function View_Map(id) {
$(document).ready(function () {

var ssId = id;

$.ajax({
url: "here our page neme where your webmathod.aspx/hotelGoogleMap",
type: "POST",
dataType: "json",

contentType: "application/json; charset=utf-8",

data: "{ 'Here you ID' : '" + ssId + "'}",
success: function (data) {
var str = data.d;

var resultValue = str.split(",");

var latitudeD = resultValue[0];
var latitudeM = resultValue[1];
var latitudeS = resultValue[2];
var LongitudeD = resultValue[3];
var LongitudeM = resultValue[4];
var LongitudeS = resultValue[5];
var description = resultValue[6];
var latitude = Number(latitudeD) + Number(latitudeM / 60) + Number(latitudeS / 3600);
var longitude = Number(LongitudeD) + Number(LongitudeM / 60) + Number(LongitudeS / 3600);

$('#dialog').dialog({
modal: true,
open: function () {
},
height: 600,
width: 800,
title: 'Sightseeing Map Details'
});

var myLatlng = new google.maps.LatLng(latitude, longitude);
var myOptions =
{
center: myLatlng,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map(document.getElementById("dialog"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
title: "lat: " + latitude + " long: " + longitude
});

marker.setMap(map);
var infowindow = new google.maps.InfoWindow({
content: "<table class='table-bordered'><tr><td colspan='2' align='center'><b>Sightseeing Detail</b></td></tr><tr><td>Latitude</td><td>" + latitude +
"</td></tr><tr><td>Longitude</td><td>" + longitude + "</td></tr><tr><td>Description</td><td>" + description + "</td></tr></table>"
});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker)
});
}
});
});

}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900