Developing the CFC map (HTML, JavaScript, PERL)

Plexus said:
New Thumbtack
comdemthumbtack.png


Edit:
And menu background-
comdemmenubg.png
Looks good but I can't use it. IE won't display png transparency (without being told which colour is supposed to be transparent), and my editor made a mess of opening it so I couldn't convert the file to gif or find out what the transparent colour is :undecide:
 
Oh, ok :p

This message is too short...
 
stormbind said:
I understand that, but there are a number of JS functions that have to be solved without JS before it can be discounted.

1. How to get new coordinates without JS?
2. How to display name & comment over the pin without JS?
3. How to generate the image without DOM?
1. Should be possible with server-side image maps.
2. Maybe it should be implemented like an "optional" feature on the site (so that map works without JS too)?
3. Umm, learn how to write gif images? :p

http://www.hk8.org/old_web/linux/cgi/ch13_01.htm
http://search.cpan.org/~addi/Imager-0.41/Imager.pm


stormbind said:
Without seeing it, you don't know what it's trying to show :(

There are buttons (top-left) for navigating the prototype.

Which browser is that? I used DOM (standards compliant) and tested in Mozilla/MSIE (with JS enabled).

Can that be solved without JS?
I use Opera (and ad filtering software too, sometimes it messes up pages :blush: )

Also I know very little about DOM, don't ask me. ;)
stormbind said:
I looked at millions of <a href=""> tags, but the filesize would be huge and it doesn't work in IE. For some reason it interlaces each line


PaintShop Pro runs client side, like JavaScript ;)

PERL is completely server-side; it will never interact with elements in the browser.
:rolleyes: :rolleyes: :rolleyes:

I know that. I was just wondering how to generate images on the fly.
 
stormbind said:
Crystal, can you explain something to me about PERL. On page 1 I posted a simple PERL script for recording data.

I have changed it (untested) and have some questions...

1. Is it OK to merge the @lines = <FILE>; because in the page 1 post it's seperate.
2. Is flock needed?
3. Is a test to see if flock worked also needed?

Here is my latest file...
1. Umm... what is this FILE again?
2. I never use flock in my programs... and is the file opened only for reading? If yes, I think flock is a little useless. :p
 
No, the file is opened for writing. PERL isn't being used for reading: There is nothing for it to read (in the prototype)!

I read that flock should be used incase there are two attempts to edit the file at the same time.
 
crystal said:
1. Should be possible with server-side image maps.
It's a lot of data. There are millions of points on the map.
3. Umm, learn how to write gif images? :p
Few hosts have that feature :(

I use Opera
Error messages? I used DOM which Opera should fully support.

I know that. I was just wondering how to generate images on the fly.
I was talking about getting the coords. If JS is used for one critical task, there is really no point in trying to avoid it's use elsewhere.

How are you going to get the coordinates without JS? I still think manually entering the lattitude/longtitude is the only way.
 
stormbind said:
Error messages? I used DOM which Opera should fully support.
There was no error messages. The pins were just in wrong places.

stormbind said:
I was talking about getting the coords. If JS is used for one critical task, there is really no point in trying to avoid it's use elsewhere.

How are you going to get the coordinates without JS? I still think manually entering the lattitude/longtitude is the only way.
Well, don't think so.
http://www.htmlhelp.com/reference/html40/forms/input.html


The image input type specifies a graphical submit button. The SRC attribute must be included to specify the URI of the image. The ALT attribute should be used to give replacement text for those not loading images. ALT is a new addition in HTML 4.0; many browsers rely on either the NAME or VALUE attribute as alternate text, so authors should use all three attributes for the same purpose where possible. The topic of graphical submit buttons for text users is discussed in detail in the article INPUT TYPE=IMAGE for text users?.

When the graphical submit button is clicked, the coordinates of the click are sent with the form submission as name.x=x-value and name.y=y-value where name is the value of the NAME attribute, x-value is the click's pixels from the left of the image, and y-value is the click's pixels from the top of the image. The USEMAP attribute combined with TYPE=image defines a client-side image map that can be used with client-side scripting, but this method is poorly supported. The USEMAP attribute gives the URI of the defining MAP.
After that just process the input with Perl in some way, or something...
 
Crystal, I don't see how that is related.

I think you need to see the prototype before we will be talking about the same thing.
 
stormbind said:
Crystal, I don't see how that is related.

I think you need to see the prototype before we will be talking about the same thing.
Hmm, I thought you meant how the posting of new coordinates should be implemented.

Anyway, I looked at the prototype and I think the small windows popping up when you move your mouse over a pin are a non-critical feature and it doesn't matter too much if they are on the page or not...
 
When you post [which I just broke - oops :blush:], how will the <form></form> get the coordinates from the map?

At the moment, it's using JavaScript's event.clientX and event.clientY to get an exact position of the click.

Image maps are normally used over large areas (i.e. countries) so you know in which region someone clicked - but how will it know the difference in New York and LA? :confused:
 
stormbind said:
When you post [which I just broke - oops :blush:], how will the <form></form> get the coordinates from the map?
Wasn't it explained in the page I posted? ;)

Here is also a tutorial on how to process forms in servers.

stormbind said:
At the moment, it's using JavaScript's event.clientX and event.clientY to get an exact position of the click.

Image maps are normally used over large areas (i.e. countries) so you know in which region someone clicked - but how will it know the difference in New York and LA? :confused:
Well, that's quite difficult to implement. Most likely you would need a long list of major cities and their coordinates on the map image.
 
crystal said:
Wasn't it explained in the page I posted? ;)

Here is also a tutorial on how to process forms in servers.

I know how to use forms! :dubious:

I think we have had more than one breakdown in communications ;)

Well, that's quite difficult to implement. Most likely you would need a long list of major cities and their coordinates on the map image.
A long list of cities for every nation in the world, and what about the villages? I think this solution is going nowhere fast.

How about, after entering the coordinated manually, there is a "test" button that submits them to the server and it adds the test pin to the map... before you submit the comment, so you can tweak the position.. ?
 
crystal said:
Blah, I'll just shut up if my advices are so useless. :p
No, not useless. We have different opinions, but all exploration is good.

---

There's something that bugs me about parsing every line in a file..

@lines = <DB>;
foreach $line (@lines) { if ($line =~ /<!--store-->/) { ... } }

Does it have to parse every line? It strikes me as being very wasteful of processor time.

What happens to the later lines if the loop is broken when the match is found?
 
stormbind said:
No, not useless. We have different opinions, but all exploration is good.
Just ask basic Perl questions and we should have no communication problems. ;)

stormbind said:
There's something that bugs me about parsing every line in a file..

@lines = <DB>;
foreach $line (@lines) { if ($line =~ /<!--store-->/) { ... } }

Does it have to parse every line? It strikes me as being very wasteful of processor time.
If don't know the exact array indexes, you most likely have to iterate through the whole array. But Perl should be fast in this kind of work.

stormbind said:
What happens to the later lines if the loop is broken when the match is found?
How you mean it's broken? foreach iterates through every index unless you end the loop with "last;". Btw, you can replace "foreach" with "for" here, they should do the same thing.
 
Back
Top Bottom