I am evaluating JxMaps library.
I cannot set a new icon to a marker.
Marker marker = new Marker(map);
marker.setPosition(new LatLng(39.833851, -74.871826));
ImageIcon newIcon = new ImageIcon(this.getClass().getResource("/resources/flag.png"));
marker.setIcon(newIcon);
My problem is that marker.setIcon method does not accept ImageIcon attribute but String.
How can I change it a default icon ?
Here is a link to APIs: https://www.teamdev.com/downloads/jxmaps/docs/index.html
In case you are passing string to Marker.setIcon method, you should provide URL to resource that contains desired image.
But, alternatively, you can pass reference to Icon object. This object have methods to load images. For example: