Top Constructors Methods
com.dlsc.gmapsfx.util

public Class MarkerImageFactory

extends Object
Class Inheritance
Imports
javafx.embed.swing.SwingFXUtils, javafx.scene.image.Image, javax.imageio.ImageIO, java.awt.image.BufferedImage, java.io.ByteArrayOutputStream, .IOException, java.net.MalformedURLException, .URI, .URL, java.util.logging.Level, .Logger

Author
Geoff Capper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
createMarkerImage(String uri, String type)

Takes a URI for an image contained within an application jar file and converts it into a data URI for use in a MarkerOptions object.

private static String
private static byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MarkerImageFactoryback to summary
public MarkerImageFactory()

Method Detail

createMarkerImageback to summary
public static String createMarkerImage(String uri, String type)

Takes a URI for an image contained within an application jar file and converts it into a data URI for use in a MarkerOptions object.

Usage:

markerOptions.icon(MarkerImageFactory.createMarkerImage("/path/to/my/image.jpg", "jpg"));

Currently tested to work with "jpg" and "png" files.

createMarkerImageFromFileback to summary
private static String createMarkerImageFromFile(String uri, String type)
getImageBytesback to summary
private static byte[] getImageBytes(BufferedImage image, String type) throws IOException