close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Map does not show up

Thread began 9/09/2009 7:05 pm by justinrovnanik388803 | Last modified 9/11/2009 3:14 pm by Jason Byrnes | 3296 views | 9 replies |

justinrovnanik388803

Map does not show up

Works fine when testing locally, but fails to display at all when uploaded to my server.

Entire 'google_javascript' folder has been uploaded.



View source shows this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
/*wagmp*/
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting ']' in <b>/home/jrover/public_html/google_javascript/wagmp_map_6.php</b> on line <b>43</b><br />




What am I doing wrong here? I am losing my mind with this...

Sign in to reply to this post

Jason ByrnesWebAssist

Can you send a copy of the wagmp_map_6.php file so I can investigate the code at line 43 causing the error. You can compress it into a zip file and attach the zip file to your reply.

Sign in to reply to this post

justinrovnanik388803

I have attached the original file. The problem seems to be with a misplaced quotation mark in ['HotelName"] on line 43:

(eg.)
"<strong>Address:</strong><br />".$row_rsHotels['HotelName”]


When replaced with ['HotelName'] and uploaded to my server, I get the following error in view source:

<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/jrover/public_html/google_javascript/wagmp_map_6.php</b> on line <b>74</b><br />



***view source with new 'wagmp_map_6.php' file using dynamic coordinates provided from a recordset called 'rsIndex'***



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAtDBpckeaBENJWY5lWVPNyxShyE0kW2mXS8aA0KkFzu6JDlf95RSja3ArBScQpEzGoEgacw4T2uYP4g">/*wagmp*/</script>
<script type="text/javascript">
/*wagmp*/

function wagmp_map_6() {
if(GBrowserIsCompatible()) {
if(!document.getElementById('wagmp_map_6')) return false;
var map = new GMap2(document.getElementById('wagmp_map_6'));
map.enableContinuousZoom();
map.enableDoubleClickZoom();
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
var geocoder = new GClientGeocoder();

var fromAddress = {
enabled: false,
street: '',
city: '',
state: '',
zip: '',
country: '',
full: ''
};

var icon_0 = new GIcon();
icon_0.image = 'http://google.webassist.com/google/markers/traditionalflat/pacifica.png';
icon_0.shadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.png';
icon_0.iconSize = new GSize(34,35);
icon_0.shadowSize = new GSize(34,35);
icon_0.iconAnchor = new GPoint(9,23);
icon_0.infoWindowAnchor = new GPoint(19,0);
icon_0.printImage = 'http://google.webassist.com/google/markers/traditionalflat/pacifica.gif';
icon_0.mozPrintImage = 'http://google.webassist.com/google/markers/traditionalflat/pacifica_mozprint.png';
icon_0.printShadow = 'http://google.webassist.com/google/markers/traditionalflat/shadow.gif';
icon_0.transparent = 'http://google.webassist.com/google/markers/traditionalflat/pacifica_transparent.png';


var address_0_0 = {
street: '',
city: '',
state: '',
zip: '',
country: '',
infowindow: 'custom',
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Address:</strong><br /><br />, </span>',
full: ', , , ',
isdefault: true,
addressType: 'address',
loop: 'rsHotels',
latitude: '',
longitude: '',
markerStyle: 'Google Traditional (flat)',
markerColor: 'Pacifica'
};

geocoder.getLatLng (
address_0_0.full,
function(point) {
if(point) {
var marker = new GMarker(point, icon_0);
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(address_0_0.infowindowtext);
});
if(!fromAddress.enabled || 'address_0_0' != 'address_0_0') {
map.setCenter(point, 13);
map.addOverlay(marker);
marker.openInfoWindowHtml(address_0_0.infowindowtext);
}
}
else {
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
);
<br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/home/jrover/public_html/google_javascript/wagmp_map_6.php</b> on line <b>74</b><br />


}
}</script>
</head>

<body>
<div id="wagmp_map_6" style="width: 240px; height: 320px;"></div>
<br />
<div>786</div>

<div>784</div>
<div>783</div>
<div>782</div>
<div>781</div>
<div>780</div>
<div>779</div>

<div>778</div>
<div>777</div>
<div>776</div>


<script type="text/javascript" src="google_javascript/wagmp_maps.js">/*wagmp*/</script></body>
</html>


Thanks!!

Attached Files
wagmp_map_6.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The problem is this code:

php:
$row_rsHotels['HotelName”]




change line 43:

php:
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><?php echo str_replace("'""\'""<strong>Address:</strong><br />".$row_rsHotels['HotelName”]  ."<br />".$row_rsHotels['HotelCity']  .", ".$row_rsHotels['HotelState']  ." ".$row_rsHotels['HotelZip']  .""); ?></span>',




to:

php:
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><?php echo str_replace("'""\'""<strong>Address:</strong><br />".$row_rsHotels['HotelName']  ."<br />".$row_rsHotels['HotelCity']  .", ".$row_rsHotels['HotelState']  ." ".$row_rsHotels['HotelZip']  .""); ?></span>',
Sign in to reply to this post

justinrovnanik388803

Do I need to change anything called '$rsHotels' on 'wagmp_map_6.php' to the name of the recordset I'm using on my site (which is called rsIndex)?

Sign in to reply to this post

Jason ByrnesWebAssist

if rsIndex is the recordset that returns the addresses, then yes, that should be the one used in the wagmp_map_6.php.

Sign in to reply to this post

justinrovnanik388803

Ok so I can now see my map, and it loads the coordinates from my recordset, but I have two problems:

1.) The repeat region (rsIndex) on my page that corresponds to the points on my map has dissapeared, and will re-appear if I delete <?php include("google_javascript/wagmp_map_6.php"); ?>

2.)The map is geocoding the addresses instead of using the coordinates.

Again, if I test locally everything works great, but as soon as I upload them to my server I have problems.


I attached the view source...

Attached Files
viewsource.txt
Sign in to reply to this post

Jason ByrnesWebAssist

1) You are entering addresses, not coordinates so it has to use the geocoder to find the coordinates that correspond to the address you have entered.

You are also using an older version. The newer version of Pro Maps for Google will create an XML File that contains the coordinates for you addresses after the first time you view then map to use the coordinates instead of the geocoder on subsequent visits to the page. If you have Pro Maps V2, You should uninstall your currant version of Pro Maps and install the version available from the download center.

2) Try adding the following code just before the repeat region to reset the recordset back to the first record:

php:
<?php

mysql_data_seek
($rsIndex0);
$row_rsIndex mysql_fetch_assoc($rsIndex);
?>
Sign in to reply to this post

justinrovnanik388803

All problems solved

Thank you so much, Jason!! You are a master!

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...