473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

RESOLVED: calling a function from inside another function

Hi,

I am working on a google map where you can show lines on the map by checking checkboxes. Lines are displayed according to their category attribute in the xml file. The function that picks up the checkbox click is like this:
Expand|Select|Wrap|Line Numbers
  1.  function boxclick(box,category) {
  2.         if (box.checked) {
  3.           show(category);
  4.         } else {
  5.           hide(category);
  6.         }
Another part of the code assigns that category attribute to arrows, so that when a line of "x" category is displayed, the relevant arrows are displayed along with it, to indicate directionality.

I also have a select list which displays the lines by looping through their array and using selectedIndex in a function called handleSelected2. But I can't get the arrows to display along with the lines from the select box. After trying many, many things, I figure that all I need to do is to call the show(category) function from inside the handleSelected2 function and it should all come together. So I came up with this:

Expand|Select|Wrap|Line Numbers
  1. function handleSelected2(opt,category) {     
  2.   for (var h = 0; h <gpolylines.length; h++) {
  3.           gpolylines[h].hide();
  4.         }
  5.          h = opt.selectedIndex - 1; 
  6.         if (h > -1) {
  7.           gpolylines[h].show();
  8.          }
  9.          for (var v=0; v<pts.length; v++) { 
  10.          show(category); 
  11.            }
  12. }    
  13.  
which gets me lines, but no arrows. You can see it sort of working here:
http://www.xelawho.com/map/zonesarrowstest.htm

I figure I've got to be close, because if I just tell it to show all the arrows (without going through the category filter) like this:

Expand|Select|Wrap|Line Numbers
  1. function handleSelected2(opt,category) {     
  2.   for (var h = 0; h <gpolylines.length; h++) {
  3.           gpolylines[h].hide();
  4.         }
  5.         var h = opt.selectedIndex - 1; 
  6.         if (h > -1) {
  7.           gpolylines[h].show();
  8.           }
  9.        for (var i=0; i<pts.length; i++) {
  10.          pts[i].show();
  11.         }
  12.     }
then all the arrows show up, as you can see here: http://www.xelawho.com/map/zonesarrowstest2.htm

I'm not getting any error messages and I've tried pretty much everything I can think of... I've been tweaking this for days and it's driving me crazy. Does anybody else have any ideas?

Thanks in advance.
Nov 24 '10 #1
2 1510
acoder
16,027 Expert Mod 8TB
Resolved? Care to post the solution?
Nov 28 '10 #2
sure. or better yet, you can read the entire thread :)

http://www.codingforums.com/showthread.php?t=210208
Nov 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bryan Parkoff | last post by:
I know how to write "Pointer to Function" inside struct or class without using static, but I have decided to add static to all functions inside struct or class because I want member functions to be...
3
by: darrel | last post by:
In my XSLT, I'm trying to write out some dynamic URLs. I can't put an actual xsl:value-of field inside a URL: <a href="<xsl:value-of select="linkUrl"/>"> But I can do this: <a...
2
by: Jeff Wilson | last post by:
Lots of posts explained to me how to invoke a function inside a form from another form. Unfortunately, it appears that a function inside a form can have at most 1 argument. I can create a form...
20
by: spasmous | last post by:
main() { float * f; initialize_f(f); // ...use f for processing free(f); }
2
by: Syl | last post by:
Hi Group - I have a function to send an email to a client after they have successfully submitted a form on my site. I have a 2nd function that prints their input to the browser as a confirmation....
3
by: Zongjun Qi | last post by:
Hey, In the book <Effective C++>, the author provides an example to prove why we need "pass by reference". I redoed the example, and found something interesting. The codes are:...
3
by: thecoolone | last post by:
I am trying to call a function from "a href" inside the same page. this is the code: echo "<br><br><a href=\"isearch($query)\">More results from Mysite</a>"; // calling the function isearch ...
4
by: MasterVision | last post by:
Hey folks, I have .NET Solution with the combinations of VB, C/C++ and C# projects on it. I have no problem calling C/C++ function inside my VB project but I dont know how to do the same with C#...
20
oll3i
by: oll3i | last post by:
how do i add a function i want to use inside another js function belonging to js class ?
3
by: Alain Bourgeois | last post by:
Dear all, I have an asp module connecting to a MS-access database. I have a vb function MKDate(date, time) in a vba module of this database. I would like to query : SELECT MKDATE(col1,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.