473,786 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RESOLVED: calling a function from inside another function

17 New Member
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 1519
acoder
16,027 Recognized Expert Moderator MVP
Resolved? Care to post the solution?
Nov 28 '10 #2
lucas vidgen
17 New Member
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
3982
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 bound inside struct or class to become global functions. It makes easier for me to use "struct.memberfunction()" instead of "globalfunction()" when I have to use dot between struct and member function rather than global function. I do not have...
3
1940
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 href="{linkURL}">
2
2114
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 function that accepts multiple arguments, but when I add a call to this function from elsewhere, Access generates a Compile/Syntax error. Is this true? Is the only way around it to join multiple arguments into a string before the call and...
20
10763
by: spasmous | last post by:
main() { float * f; initialize_f(f); // ...use f for processing free(f); }
2
1643
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. I'd like to be able to include that print function inside my mail message like this : function sendToClient($email) { $subject = 'Confirmation'; -----> $message = printConfirm($lang); <----
3
1567
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: ############################## #include <iostream> class Student{ public:
3
2516
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 function isearch($query) {$query=urlencode($query);
4
9256
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# Project. How to call C# function inside VB.NET? Any help would be highly appreciated. Thank you
20
1900
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
5114
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, col2) FROM TABLE1 (real query is complex, using unions, etc, but I need one column in
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.