Hello there!
After spending several hours I managed to get the Map working. This is the Code that worked for me:
Map.ascx-File
Control keeps positioning in the upper left corner. I changed the attributes for the map-div and it positioned right.
Code:
<div id="theMap" style="position:relative; width: 520px; height: 500px;"></div>
Map.
js-File
Code:
//If we've found exactly one place, that's our address.
if (points.length === 1) {
$("#Dinner_Latitude").val(points[0].Latitude);
$("#Dinner_Longitude").val(points[0].Longitude);
}
instead of
Code:
//If we've found exactly one place, that's our address.
if (points.length === 1) {
$("#Latitude").val(points[0].Latitude);
$("#Longitude").val(points[0].Longitude);
}
Latitude and Longitude won´t be set with the code from book. With this little change it works.
DinnerForm.ascx-File
Changed the Script to:
Code:
<script type="text/javascript">
$(document).ready(function () {
$("#Dinner_Address").blur(function (evt) {
//If it's time to look for an address,
// clear out the Lat and Lon
$("#Dinner_Latitude").val("0");
$("#Dinner_Longitude").val("0");
var address = jQuery.trim($("#Dinner_Address").val());
if (address.length < 1)
return;
FindAddressOnMap(address);
});
});
</script>
I hope that it is a help for you guys trying to get this map working.