Wrox Programmer Forums
|
BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9
This is the forum to discuss the Wrox book Professional ASP.NET MVC 1.0 by Rob Conery, Scott Hanselman, Phil Haack, Scott Guthrie; ISBN: 978-0-470-38461-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2011, 01:58 PM
Registered User
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Map Chapter 1

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing CSS for Map in Chapter 1 rootberg BOOK: Professional ASP.NET MVC 2 0 July 2nd, 2010 02:02 PM
Map tedr BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 2 April 6th, 2010 10:55 AM
Chapter 1 - Service-oriented view of MAP memuralidhar BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 July 6th, 2009 12:23 PM
how to map a url to another? worldcrafter Apache Tomcat 0 April 2nd, 2008 06:19 PM
Heat Map over Google Map ajit Javascript 0 March 7th, 2008 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.