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
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 Search this Thread Display Modes
  #1 (permalink)  
Old August 5th, 2008, 07:47 AM
Authorized User
 
Join Date: Jul 2008
Location: Brisbane, Queensland, Australia.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to ramone_johnny
Default Hacked Bills Google Maps Code

Bill,
Ive just successfully hacked away at your code and got it working. Dont ask me how but Im sure as hell it cant be right. *shrugs*

Anyway, would you mind taking a look at it and correcting it where necessary (as well as telling me how badly written it is)

<script type="text/javascript">
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var latitudes = new Array( );
        var longitudes = new Array( );
        var markers = new Array();

        var mappy = new GMap2(document.getElementById("mappy"));
        mappy.setCenter(new GLatLng(<%=share_latitude%>, <%=share_longitude%>), 15);
        latitudes = <%=share_latitude%>;
        longitudes = <%=share_longitude%>;
        var icon = new GIcon();
        icon.image = "/images/marker1.png"
        icon.shadow = "/images/shadow-marker1.png";
        icon.iconSize = new GSize(16.0, 33.0);
        icon.shadowSize = new GSize(33.0, 33.0);
        icon.iconAnchor = new GPoint(8.0, 30.0);
        icon.infoWindowAnchor = new GPoint(8.0, 16.0);

        markers[1] = new GMarker(new GLatLng(<%=share_latitude%>, <%=share_longitude%>), icon);
        // Show info about this marker when it is clicked
        //GEvent.addListener(markers[1], "click", function() { markers[1].openInfoWindowHtml("Address:<br/><%=addr%>"); } );
        // and add this marker:
        mappy.addOverlay(markers[1]);
      }
    }
</script>

webdesigndocuments.com
__________________
Works Media - Online Marketing & SEO
Reply With Quote
  #2 (permalink)  
Old August 5th, 2008, 12:42 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Aside from creating arrays that you never use in this code, it seems simple enough and correct enough.

Just change the lines
        var latitudes = new Array( );
        var longitudes = new Array( );
to
        var latitudes;
        var longitudes;

And you don't really need the markers array, but it won't hurt anything.
Reply With Quote
  #3 (permalink)  
Old August 5th, 2008, 07:19 PM
Authorized User
 
Join Date: Jul 2008
Location: Brisbane, Queensland, Australia.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to ramone_johnny
Default

Thanks Bill,
Is there a way if the user hasnt specified an actual street address (meaning, they have only submitted a suburb) to NOT show the marker.

At the moment the marker is showing regardless, and its often confusing.

John

webdesigndocuments.com
Reply With Quote
  #4 (permalink)  
Old August 5th, 2008, 07:24 PM
Authorized User
 
Join Date: Jul 2008
Location: Brisbane, Queensland, Australia.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to ramone_johnny
Default

Ooh, I think I have it *pumps eyebrows

Hows this look?

<%if share_street <> "" then%>
        markers[1] = new GMarker(new GLatLng(<%=share_latitude%>, <%=share_longitude%>), icon);
        // Show info about this marker when it is clicked
        //GEvent.addListener(markers[1], "click", function() { markers[1].openInfoWindowHtml("Address:<br/><%=addr%>"); } );
        // and add this marker:
        mappy.addOverlay(markers[1]);
        <%end if%>

webdesigndocuments.com
Reply With Quote
  #5 (permalink)  
Old August 5th, 2008, 09:45 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Looks right to me.
Reply With Quote
  #6 (permalink)  
Old August 5th, 2008, 10:11 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

By the by... The "demo" he is referring to is the first one here:
     http://www.clearviewdesign.com/clear...bie/demos.html

But I just noticed that I forgot to provide a link to the ASP source code! I'll add that ASAP.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Bills Whiz Bang Google Maps ramone_johnny Classic ASP Basics 2 August 1st, 2008 07:23 PM
Google Maps JS in ASPX page error kingroon ASP.NET 2.0 Basics 0 December 7th, 2007 09:52 AM
INFO: Adding Google Maps (New ASP.Net Control) jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 September 12th, 2007 03:18 AM
XSL, Javascript and Google maps.. tomharding XSLT 2 March 14th, 2007 06:10 PM
Site Hacked!!! (Please help) ishh_sh Classic ASP Professional 9 January 24th, 2007 03:38 AM



All times are GMT -4. The time now is 02:17 PM.


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