close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Editing the wagmap_map_1.js file

Thread began 10/06/2010 8:52 pm by Screamin'Dean | Last modified 10/07/2010 1:36 pm by Jason Byrnes | 2522 views | 13 replies |

Screamin'Dean

Editing the wagmap_map_1.js file

Hi - I'm trying to get the custom focus function to work. I think my problem is in editing the wagmap_map_1.js file (in particular line 26 - Dreamweaver tells me I have a syntax error when I remove the } bracket)

Can someone please check the below for me. Line 26 is the 3rd from the bottom...

function WAMapRef(mapObj) {
this.obj = mapObj;
this.directions = false;
this.icons = [];
this.markers = [];
this.addresses = [];
this.points = [];
this.getPointByAddress = getPointByAddressFunc;
this.addressFailed = true;
return this;
}

function WAMapPoint(theMarker, theAddress, theIcon, point, map) {
this.icon = theIcon;
this.marker = theMarker;
this.address = theAddress;
return this;
map.setCenter(point, 13);
}

function getPointByAddressFunc(value,attname) {
if (!attname) attname = "street";
for (var x=0; x < this.addresses.length; x++) {
if (eval("this.addresses[x]."+attname) == value) {
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x]);
}
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
return false;
}

Sign in to reply to this post

Jason ByrnesWebAssist

change:
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x]);
}
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
return false;
}
Edit/Delete Message

to:

return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
return false;
}
Edit/Delete Message

Sign in to reply to this post

Screamin'Dean

Hi - thanks, but still no go. The .js now looks like this

function WAMapRef(mapObj) {
this.obj = mapObj;
this.directions = false;
this.icons = [];
this.markers = [];
this.addresses = [];
this.points = [];
this.getPointByAddress = getPointByAddressFunc;
this.addressFailed = true;
return this;
}

function WAMapPoint(theMarker, theAddress, theIcon, point, map) {
this.icon = theIcon;
this.marker = theMarker;
this.address = theAddress;
return this;
map.setCenter(point, 13);
}

function getPointByAddressFunc(value,attname) {
if (!attname) attname = "street";
for (var x=0; x < this.addresses.length; x++) {
if (eval("this.addresses[x]."+attname) == value) {
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
return false;
}
}

but the map is not showing. The page link is here &#8230;

[url removed]

Sign in to reply to this post

Jason ByrnesWebAssist

you have an extra "}" at the end



change:
return false;
}
}

to:
return false;
}

Sign in to reply to this post

Screamin'Dean

Thanks. .js now reads

function getPointByAddressFunc(value,attname) {
if (!attname) attname = "street";
for (var x=0; x < this.addresses.length; x++) {
if (eval("this.addresses[x]."+attname) == value) {
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
return false;
}


I'm editing the code in Dreamweaver. When I remove the second } DW wants me to add another at the very end.

Sign in to reply to this post

Jason ByrnesWebAssist

the full function should be:

function getPointByAddressFunc(value,attname)  {
if (!attname) attname = "street";
for (var x=0; x < this.addresses.length; x++) {
if (eval("this.addresses[x]."+attname) == value) {
return WAMapPoint(this.markers[x],this.addresses[x],this.icons[x], this.points[x], this.obj);
}
}
return false;
}
Sign in to reply to this post

Screamin'Dean

Thanks again, but …

Sign in to reply to this post

Jason ByrnesWebAssist

I'm sorry, what is this screen shot supposed to illustrate?

I don't see anything obvious.

Sign in to reply to this post

Screamin'Dean

Thanks, Jason. Dreamweaver still gives me the syntax error after adding your latest instruction.

The screen was meant as reference.

Sign in to reply to this post

Jason ByrnesWebAssist

I dont see a syntax error in that screen shot.

regardless of Dreamweaver, does it work if you upload it?

can you send a copy of the files so I can examine the entire code.

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...