Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Far away
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to create a dynamic image map? Any easy way?

    Hi, how're ya?

    Maybe my question doesn't really fit, but if you go to www.realtor.com or www.springstreet.com, you see they're giving ya the option to search your house via map. Well, as far as I know, a dynamic site like realtor.com should have the possibility for the admin(s) to add their states/cities in the database. So, it's not a static site that you can work on the images yourself and make hot spots, rather you should get the state's map from the user and then let them make the hot spots on it themselves, am I right? So, it's only this way that you can be sure that they can make any spot on the map themselves and they don't need ya at all. Can you think of any easier way to write such thing? I mean for each map letting the user defining the hotspots is too complicated, even though I thought of some javascript/php integration to do the trick, but it's still hard to make it, any ideas??

    Thank you

  • #2
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Far away
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello? NO body knows the answer?! PLEASE ...

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Well it's not just some simple easy answer. You are talking about custom software that will have a lot of moving parts. You need to be more specific with your questions.

    As a general rule in developing a user interface, don't require the user to have to do complex things and don't give them too much control.

    Just predefine areas/regions on the map. If the visitor is going to click on a map for their location they aren't going to be precise. For example if this is for the U.S. just have the states defined and when the person clicks on their state generate a list of links or a drop down containing the cities listed for that state. Don't make things too complex or people won't want to come back to use your site again. And along with that imagemap you must always provide an alternative method of selection as the person may not be able to view images on their browser or they may be visually impaired and require use of a screen reader.

    Here is a good example:

    http://www.apartmentratings.com/
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Far away
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you spookster, finally an answer!

    Yes yes, I understand, it's not an easy question and actually it's the whole software. Lemme be more specific. You gave me apartmentratings.com, ok? That site is not dynamic. I mean when I go on any part of that map, for each city it defined an HTML page, not a php page, do you understand what I'm talking about? If it's dynamic, then we didn't have to have lots of pages, we only had to have one page which accepted some variables to find out which city we are refering to. So, the designer of that site didn't have to do much, he only made several pages (to the number of availabe cities) and then he made that image map.

    What if we want to make a sort of CMS that the admin of the site can define the portions himself?! Of course he doesn't know anything about HTML and he's not willing to make all those HTML pages. Do you understand what I'm saying? Even if I were the site admin myself, I didn't like to put all my cities in the database, then cut that map into pieces and add the id of each city to the end of my php page (like a query string). It's just too hard and too amateure, do you understand me now?

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Ok first of all just because pages are using the extension .html does not mean some kind of server-side language is not being used. You can put your PHP/ASP/Perl or whatever coding into pages with extensions .html as long as you define those pages as needing to be parsed by the respective PHP/ASP/Perl engine. In the case of that site they are definitely doing that. That site is dynamic.

    As for what you want go look around places like www.hotscripts.com and also learn PHP because what you want you exactly you are probably not going to find.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Far away
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey, sorry but I think I know PHP fair enough to ask this. I wrote some sites with it and it definitely makes me think that I'm not a newbie! Of course if we don't wana say that everyone at any stage is a newbie to the mighty world of programming. Anyways, let's re-phrase my question and ask it in this way: What would you do if you wanted to write such thing? Did you enter your cities in the database and then for the id of each city you cut the specified part of the map and then put that id for it? Or is there any other way that you know?

    Thanks for your patience

  • #7
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just becuase you have written a site in PHP, doesnt mean you arent a newbie... :P

    Anyways, there are several ways you could accomplish this.

    You could Store values in a MySQL database
    You could store values in a textfile
    You could use PHP includes
    You could even use javascript, although i dont reccomend this.

  • #8
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    there are databases available (for $$) that contain postcode info along with latitude and longtitude data , check your countries Postal Service Website.

    Once you have that you can use any image map to get rough lat' and longtitude data after a bit of ratio/scaling , remember when you click on an image map the exact co-ordinates of that click get passed to whatever is handling the request (watch out as PHP replaces periods for underscores in $_GET requests) which makes for pixel sized resolution , eg you don't even need an image map , just use an image as a submit button and then start munging the click cordinates in your database.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #9
    New to the CF scene
    Join Date
    Sep 2003
    Location
    Far away
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by missing-score
    Just becuase you have written a site in PHP, doesnt mean you arent a newbie... :P

    Anyways, there are several ways you could accomplish this.

    You could Store values in a MySQL database
    You could store values in a textfile
    You could use PHP includes
    You could even use javascript, although i dont reccomend this.
    Yeah, you're right!

    Anyways, thank you firepages, you mean I can use some ready databases to work with and they all have the map. Well, that's cool. So, as I found out you're telling me the same answer that I thought about, if I wana give the possibility to my user (just a hypothetic question, ok) to work on his own map and cut it into pieces, I have to write a wizard like the one that Frontpage has with Javascript or another client side language and then I can save it into my db.

    Ok, now if I don't wana do that and I also do not wana spend $$ for those ready dbs, then I can wait till the name of all cities/regions are entered in my db and then when I'm sure I have the id of all of them, I make these maps manually, means I cut them myself and put the relevant id for each region myself. right?

    Thank you all, you are sooooooooooo kind


  •  

    Posting Permissions

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