7

I am currently saving a .dwg file as .dxf, opening in Illustrator, saving as .svg, and then embedding it in an html document using Polymaps. The desired result is to have an event floor plan. The floor plan is over 1,000,000 sq. ft. so I believe tiling is the only way to have something that is usable with mobile devices (due to load times)

I am unable to locate any information on how to create tiles from the SVG file and then use them with Polymaps. I'm unfamiliar with this so, although I've read the Polymaps documentation in it's entirety, I'm not certain I'll be able to implement even after having the tiles.

I would appreciate any resources on creating tiles from a .svg that can be used with Polymaps and further, more detailed examples on using Polymaps.

Thank you,

Chris

Erik Dahlström
  • 59,452
  • 12
  • 120
  • 139
Chris Rockwell
  • 1,688
  • 2
  • 21
  • 36

1 Answers1

0

While Polymaps has SVG support, one simple option is to export your SVG as a very large image, and then use a map tiling utility to export it.

I just tried out GDAL, which seems like the underlying utiliy a lot of the commercial tools are built off of. General is here: http://www.gdal.org/

A quick recipe to create map tiles from a large Raster image.

  1. For OSX, you can download a precompile of the GDAL utility here: http://www.kyngchaos.com/software/frameworks

  2. Run the installer, then open terminal and export the Python scripts into your path:

    export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

  3. Use gdal2tiles command to create your tiles. http://www.gdal.org/gdal2tiles.html. Here's a command that I did, which creates a bunch of tiles, and sample openlayers html demo! from your source.

    gdal2tiles.py -p 'raster' largeexported_image.png -z 2-5

If you'd like to use Polymaps in particular, I believe its possible to consume the tiles exported from gdal, but I haven't tried that. This should meet your need of creating a pure JS tile map in HTML.