Results 1 to 8 of 8

Thread: Pointing to a place and recalling the location.. Layers ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312

    Pointing to a place and recalling the location.. Layers ?

    Right, imagine a map that will one day be on my website!!! What i want to be able to do is put another picture on top of that at a certain point relating to the place clicked on the map. I.E. I click somewhere and the pin goes there. I also want to be able to save this pisition to a text file (which i can do) but then recall it when the page reloads and put it back on the map for all people to see (which i cant do).

    I know this is possible in javascript but as i cant do javascript and like PHP more, does anyone know how to do this ??

    Thanks!
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    if you don't want the page to reload eveytime then you have to do it with javascript. with php it will need to be reloaded.

    javascript will have to be run as you would need the postion of the mouse cursor and then save those positions to a file with php.

    other than that I don't think you can do it any other way.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    so it wouldnt be possible iwth opurely PHP ? cannot PHP track a location of a cursor on an image ??

    hmmm, ill hav ea look at some javascripting tutorials then thanks for your help
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    php is all server side and can't see the client side of things, so the only way to do it is to use javascript as that is client side.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    so what i could do is use javascript to log the position of the cursor and then write it to an integer for example. I could then use PHP to write that co-ordinate to a file!!

    Then as the page re-loads, it reads the file with the co-ordinates in, then plots the little picture of a pin to that co-ordinate on the map...

    will this work ?

    thanks
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    Originally posted by phpman
    php is all server side and can't see the client side of things, so the only way to do it is to use javascript as that is client side.
    oh, and that is possibly one of the most useful things i have ever been told about PHP, really!
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  7. #7
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Originally posted by JafferAB
    so what i could do is use javascript to log the position of the cursor and then write it to an integer for example. I could then use PHP to write that co-ordinate to a file!!

    Then as the page re-loads, it reads the file with the co-ordinates in, then plots the little picture of a pin to that co-ordinate on the map...

    will this work ?

    thanks
    that just might work. php can read some variables from javascript so it might work like you say.

    now are really serious as to what you said in your last post or jsut being a smarty

  8. #8
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    With your javascript, you can send the Browser to a an extra page
    "map.php" using javascript to pass "x=?&y=?&page=????" to it, and then write the file with that, and then
    header("Location: $page");

    and when it reloads, it can read the x=??&y=?? and make a javascript x=<?php echo $x;?> y=<?php echo $y;?>

    JavaScript put the persons mouse there?

    I dont know how to do this, but it should be possible?

    (MySQL may be easier for it, not too sure .. Cuz it mite need to deal with IP's unless u set a cookie?
    Wayne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width