Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 3rd, 2011, 12: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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08:01 AM



All times are GMT -4. The time now is 05:55 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.