tillnagel / unfolding

A library to create interactive maps and geovisualizations in Processing and Java
http://unfoldingmaps.org
Other
477 stars 245 forks source link

MarkerFactory: possibility to use another class than MultiMarker #115

Closed FogiaFr closed 9 years ago

FogiaFr commented 9 years ago

In the MarkerFactory, SimplePointMarker, SimpleLineMarker and SimplePolygonMarker can be overwritten with the setXXXClass but the MultiMarker can't.

A possible way to do this can be found there: https://github.com/FogiaFr/eu/blob/master/front/eu-front-client/src/main/java/com/mkl/eu/front/client/map/marker/MarkerFactory.java The changes are:

tillnagel commented 9 years ago

Thanks, interesting idea.

Can you say a bit more about why you need this, or how you are using it? (Not so much about the implementation, but on your intended usage). For now, we see the MultiMarker simply as a composite.

FogiaFr commented 9 years ago

I am developping a game that used a Map (the World Map) and the map is divided in provinces. Some provinces are MultiPolygon (for example, Scotland and the nearby islands or provinces that are in the 'normal' map and in zoom focus map). And since I use my markers (I extends the Marker class but I need a custom class to handle some events like drag and drop of counters for example), I need to have an implementation for MultiMarker.

tillnagel commented 9 years ago

Thanks @FogiaFr for the suggestion. See MultiMarkerTestApp.java for an example, as I implemented it a bit simpler than in your implementation. Let me know if that is not sufficient.