View LatLong.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GoogleMap map = googleMapView.createMap(mapOptions, false); | |
map.addMouseEventHandler(UIEventType.click, (GMapMouseEvent event) -> { | |
LatLong latLong = event.getLatLong(); | |
System.out.println("Latitude: " + latLong.getLatitude()); | |
System.out.println("Longitude: " + latLong.getLongitude()); | |
}); |
View BayesScript.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("tm") | |
install.packages("e1071") | |
install.packages("gmodels") | |
install.package"" | |
library(tm) | |
library(e1071) | |
library(gmodels) | |
library(wordcloud) | |
set.seed(123) |
View latlongclick.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map.addUIEventHandler(UIEventType.click, (JSObject obj) -> { | |
LatLong ll = new LatLong((JSObject) obj.getMember("latLng")); | |
System.out.println("LatLong: lat: " + ll.getLatitude() + " lng: " + ll.getLongitude()); | |
}); |
View ProductSummaryBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lynden.mapdemo; | |
import java.text.DecimalFormat; | |
import java.util.Objects; | |
public class ProductSummaryBean { | |
protected double price; | |
protected String name; | |
protected String upcCode; |
View HashMapTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void runTest() { | |
ProductSummaryBean summaryBean = new ProductSummaryBean(19.95, "MyWidget", "Z332332", new DecimalFormat("$#,###,##0.00")); | |
ProductDetailsBean detailBean = getProductDetailsBean(summaryBean); | |
productMap.put(summaryBean, detailBean); | |
//Load the same summaryBean from the DB | |
summaryBean = loadSummaryBean("Z332332"); | |
//Pull the detailBean from the map for the given summaryBean |
View FXMLController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lynden.gmaps.directions; | |
import com.lynden.gmapsfx.GoogleMapView; | |
import com.lynden.gmapsfx.MapComponentInitializedListener; | |
import com.lynden.gmapsfx.javascript.object.*; | |
import com.lynden.gmapsfx.service.directions.*; | |
import java.net.URL; | |
import java.util.ResourceBundle; | |
import javafx.beans.property.SimpleStringProperty; | |
import javafx.beans.property.StringProperty; |
View FXMLController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lynden.gmaps.directions; | |
import javafx.application.Application; | |
import static javafx.application.Application.launch; | |
import javafx.fxml.FXMLLoader; | |
import javafx.scene.Parent; | |
import javafx.scene.Scene; | |
import javafx.stage.Stage; | |
View Scene.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import com.lynden.gmapsfx.GoogleMapView?> | |
<?import javafx.scene.control.TextField?> | |
<?import javafx.scene.layout.AnchorPane?> | |
<AnchorPane id="AnchorPane" prefHeight="443.0" prefWidth="711.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.65" fx:controller="com.lynden.gmaps.directions.FXMLController"> | |
<children> | |
<GoogleMapView fx:id="mapView" layoutX="-311.0" layoutY="-244.0" prefWidth="490.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> | |
<TextField fx:id="fromTextField" prefHeight="27.0" prefWidth="222.0" promptText="From:" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="10.0" /> |
View FXMLController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FXML | |
private void toTextFieldAction(ActionEvent event) { | |
DirectionsRequest request = new DirectionsRequest(from.get(), to.get(), TravelModes.DRIVING); | |
directionsService.getRoute(request, this, new DirectionsRenderer(true, mapView.getMap(), directionsPane)); | |
} |
View FXMLController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void mapInitialized() { | |
MapOptions options = new MapOptions(); | |
options.center(new LatLong(47.606189, -122.335842)) | |
.zoomControl(true) | |
.zoom(12) | |
.overviewMapControl(false) | |
.mapType(MapTypeIdEnum.ROADMAP); | |
GoogleMap map = mapView.createMap(options); |
NewerOlder