Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am completely new to GIS theme and I found this board so I hope I can get good advices from experienced users. I need to find an open-source Java framework/library/api that would generate an map image with multiple coordinates markers. In particular I need to customize the shape of the markers (i.e. making the marker circle size bigger or smaller depending on external additional data). Moreover, it would be nice that the map would fit to the markers (so if I place markers only in Europe, the image would show Europe only, not the whole globe). The target display is a java webapp so I would nee to generate the image and get it in a byte form, so I can display it on the page. Does any one know an Java API that has such functionality? I looked at things like geotools or jmapviewer but they seem to lack the features I require.

share|improve this question

2 Answers 2

Try OpenJump. It's in java and has an API.

enter image description here

share|improve this answer

If you are making a java webabb, why not use OpenLayers (a Javascript mapping api) for displaying markers)? Or am I missing something here?

I guess you could in some way generate a GeoJSON of your data, en follow some of the examples on OpenLayers Vector Layers?

Here is one such example (well, generating data on the fly): http://openlayers.org/dev/examples/styles-context.html

And for the "map fit the contents"-requirement, use something like:

map.zoomToExtent(myvectorlayer.getDataExtent();
share|improve this answer
    
Actually I was thinking about making it more likely in the Java backing code (not javascript) but the example looks promising, so I might decide to go with that. Thanks for the suggestion. –  srd.pl May 9 '12 at 17:26
    
Maybe I should open another question but I'll try here for now - does OpenLayers work with xhtml? I was trying to implement this example (just in the raw form) on my JSF .xhtml page and the map is shown but the markers are not displayed at all. However the trick with centring the map on according to the points works, so that proves that the points are added to the maps just not displayed. –  srd.pl May 10 '12 at 12:05
    
I do not see why OpenLayers shouldn't work with .xhtml pages. I guess there are some other reason why your markers aren't displayed. I would recommend opening another question with relevant code sample(s) –  atlefren May 10 '12 at 13:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.