HTML Imagemap Export

digitalaviatordigitalaviator Global Mapper UserPosts: 76Trusted User
edited December 2009 in Suggestion Box
I've just been digging around GM10 and looking to see if this is possible...

I need to generate a clickable map for my website to make it easy to navigate, so basically it's a raster image with vector co-ordinates such as:

[HTML]<map name="FPMap0">
<area href="http://www.domain.com/target.php?target=category&category_id=29"; shape="polygon" coords="191, 178, 192, 285, 275, 285, 275, 196, 241, 194, 241, 175, 194, 176" alt="Hawaii">
<area href="http://www.domain.com/target.php?target=category&category_id=33"; shape="polygon" coords="274, 195, 398, 287" alt="Florida">
<area alt="Cuba" coords="650, 441, 652, 434, 646, 425, 691, 425, 695, 430, 752, 432, 788, 550, 742, 573, 752, 552, 717, 499, 725, 470, 692, 459, 659, 451" shape="polygon" href="http://www.domain.com/target.php?target=category&category_id=128">;
</map>
<img border="0" src="http://www.globalmapperforum.com/forums/images/map.jpg"; usemap="#FPMap0" width="800" height="600"> [/HTML]

Would this be possible for future release or do you know of any tools that can do this?

Cheers,
Dean.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited December 2009
    Dean,

    Are you wanting to draw a map from the coordinates or just define clickable regions of a raster map? You would have to have a vector definition of the click regions somewhere to generate the clickable region definitions, although you could draw those. While there isn't any direct support for this, you could export to a simple text file and perhaps write a simple program to read that and generate the HTML format that you need from the simple input.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • digitalaviatordigitalaviator Global Mapper User Posts: 76Trusted User
    edited December 2009
    Hi Mike,

    The system would work basically like the "Capture Screen Contents to Image" system, maybe with an added checkbox to say:

    "Generate HTML (imagemap) from vector data"

    So the user chooses the resolution of the JPG image exported, then based upon the vector overlay files generate the x,y,x,y,x,y co-ordinates for the clickable regions with maybe a HREF code link that has been defined in the vector file attributes...

    In simple terms what I'm looking to do (there's some plugins for ARCGIS that can do this), is generate a JPG map of the USA at a defined size with all the regions of data I've already got available visible... On top of that I have my vector USA map overlaid on the map imagery that allows users to click on the map and go to a different webpage...

    (Within each state area (outline) DBF data entry I have the link to the category/product at an online store...)

    The goal is to have a clickable HTML map that can then drill down to county size data...

    I've tried the export to simple text file but it has lat/lon data rather than pixel x,y values, and I'm not sure if there's a way to export the x,y values from an image...

    With several states being very complicated outlines it'd take a month of sundays to hand code each pixel for each state...

    I am open to creative suggestions on how to accomplish this though...

    Cheers,
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited December 2009
    Dean,

    I can think of one possible approach to this using existing methods. If you export a JPG with what you want and then a vector file with the same bounds, then load that vector file back in and export to a Simple ASCII Text file and use the Point Offset/Scale tab to provide offset values of the top left ground coordinates of your JPG and a scale factor indicative of the number of pixels per ground unit in the JPG (look at the world file for the JPG to get this), you should then get a simple text file that actually has pixel coordinates relative to the JPG file.

    If you are a programmer you could also use the Global Mapper SDK to achieve this more directly by simply converting your vector coordinates to the pixel space of the JPG layer and writing out exactly the HTML that you need.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • digitalaviatordigitalaviator Global Mapper User Posts: 76Trusted User
    edited December 2009
    Thanks Mike, I'll try and get my head around all that and give it a try... :eek:
Sign In or Register to comment.