This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JavaFX and the fly likes Performance issue with javafx 2.2 webview and openlayers. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JavaFX
Bookmark "Performance issue with javafx 2.2 webview and openlayers." Watch "Performance issue with javafx 2.2 webview and openlayers." New topic

Performance issue with javafx 2.2 webview and openlayers.

Abhishek Jain B

Joined: May 21, 2013
Posts: 1
Hi Team,
i am running javafx 2.2 from jdk7u21.
openlayers version used is 2.12
when i am trying to add a huge number of vectors to a vector layer, the CPU usage goes high and nothing gets displayed.
Most of the CPU usage is done by
it works well till around 4K vectors, but goes for a toss beyond that.

OpenLayers Code is as follows.
vector layer Definition
var vector1= new OpenLayers.Layer.Vector("Drivers",{
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
pointRadius: 3,
fillColor : "blue",
graphicName : "circle",
fillOpacity : 1
"select": new OpenLayers.Style({
externalGraphic: "${select_externalGraphic}"
"featureselected": function(e) {
//TODO: on Selection
app.printOnConsole("From Vector Event>>";
app.printOnConsole("From Vector Event"+Object.toJSON(e.feature.attributes));
"featureunselected": function(e) {
//TODO: on Deslect:

Adding the vector code
var mymarker = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(LON,LAT),{
default_externalGraphic: 'triangle_8.png',
select_externalGraphic: 'triangle_8.png',
rat : jsonObj.rat

Please suggest if there is a way i can fine tune my code to display the vectors.
John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 213

See Oracle JavaFX forum: Thread: Performance issue using WebView and OpenLayers
I agree. Here's the link:
subject: Performance issue with javafx 2.2 webview and openlayers.
It's not a secret anymore!