• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i put different layers on an image?

 
Carlos Palmer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm about to start writing a map-making package.
My problem is that each particular map that a user constructs can have
up to several different layers i.e. one layer would show the telephone lines for the area , another the roads ,other's being rivers, gas lines, housing, forestation.
Now the user may wish to view/edit/print the several layers at the same time , or he may wish to view a single layer , or a combination of different layers.
How do i implement this.Someone mentioned i'd have to use rasters!
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Offhand, I'd try to create a set of separate images which are mostly transparent, and then display them one atop another, probably using JLayeredPane. You could first put all the images into separate layers, and then turn them "on" and "off" using setVisible() on each image. I haven't actually done this, so it may not work - but it seems worth a try unless a better-informed suggestion comes along. (And if you do try it, please post again to let me know if it does work, or what problems you experienced.) Good luck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!