I recently received a question regarding how to add the GMapsFX component to SceneBuilder, so it could be dragged and dropped onto the UI as its being constructed.
I thought I would address the question here since the good folks at Gluon have made it extremely easy to import custom components to SceneBuilder.
The first step is to click the small ‘gear’ icon just to the right of the Library search box and select the “JAR/FXML Manager” menu item from the popup menu.
Since the GMapsFX binaries are in the Maven Central repository SceneBuilder can directly download and install the component from there. Click the “Search repository” link in the Library Manager dialog box.
Next, enter “GMapsFX” into the Group or artifact ID text box, and click the “Search” button. You should get a search result with the com.lynden:GMapsFX artifact. Select the result and click “Add JAR”.
The GoogleMapView should be the only component available in the Jar file, select it and click the “Import Component” button.
Finally, you should get a confirmation that the library was imported into SceneBuilder.
At this point the GoogleMapView component should be visible in the “Custom” component section of the pallette, and ready to be dragged and dropped onto your UI. Due to the way the component is constructed, a map will not display in SceneBuilder or the SceneBuilder preview tool, but the proper FXML will be generated and the map will display when the program is run.
Feel free to tweet me at: @RobTerpilowski with any questions.