Strabon

changeset 562:942a48b43164

Fixes Ticket #10

2 listeners added on geoxml3-kmz for mouseover and mouseout events.
Also, a little mistake on KMLWriter was fixed.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Tue Sep 25 22:34:52 2012 +0300 (2012-09-25)
parents 1559214d32c6
children 43f6b2907df8
files endpoint/WebContent/js/geoxml3-kmz.js resultio/src/main/java/org/openrdf/query/resultio/sparqlkml/stSPARQLResultsKMLWriter.java
line diff
     1.1 --- a/endpoint/WebContent/js/geoxml3-kmz.js	Thu Sep 20 13:18:18 2012 +0300
     1.2 +++ b/endpoint/WebContent/js/geoxml3-kmz.js	Tue Sep 25 22:34:52 2012 +0300
     1.3 @@ -1183,6 +1183,16 @@
     1.4        visible:       placemark.visibility
     1.5      });
     1.6      var p = new google.maps.Polygon(polyOptions);
     1.7 +    
     1.8 +    
     1.9 +    google.maps.event.addListener(p,"mouseover",function(){
    1.10 +    	 this.setOptions({fillColor: "#FFFFFF"});
    1.11 +    	}); 
    1.12 +
    1.13 +    	google.maps.event.addListener(p,"mouseout",function(){
    1.14 +    	 this.setOptions({fillColor: kmlFillColor.color});
    1.15 +    	});
    1.16 +    
    1.17      p.bounds = bounds;
    1.18  
    1.19      createInfoWindow(placemark, doc, p);
     2.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqlkml/stSPARQLResultsKMLWriter.java	Thu Sep 20 13:18:18 2012 +0300
     2.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlkml/stSPARQLResultsKMLWriter.java	Tue Sep 25 22:34:52 2012 +0300
     2.3 @@ -79,8 +79,7 @@
     2.4  		// (00 to ff).
     2.5  		// id, line width, line color, polygon fill, mouse over line width,
     2.6  		// mouse over line color mouse over polygon fill
     2.7 -	{STYLE_ID + "1", "1.5", "7dff0000", "7dff0000", "1.5", "7d0000ff", "7d0000ff"}, {STYLE_ID + "2", "1.5", "7d00ff00", "7d00ff00", "1.5", "7d0000ff", "7d0000ff"}, {STYLE_ID + "3", "1.5", "7d550000", "7d550000", "1.5", "7d0000ff", "7d0000ff"}, {STYLE_ID + "4", "1.5", "7d005500", "7d005500", "1.5", "7d0000ff", "7d0000ff"}, {STYLE_ID + "5", "1.5", "7d000055", "7d000055", "1.5", "7d0000ff", "7d0000ff"},};
     2.8 -	
     2.9 +		{STYLE_ID + "1", "1.5", "7dff0000", "adff0000", "1.5", "7d0000ff", "ad0000ff"}, {STYLE_ID + "2", "1.5", "7d00ff00", "ad00ff00", "1.5", "7d0000ff", "ad0000ff"}, {STYLE_ID + "3", "1.5", "7d550000", "ad550000", "1.5", "7d0000ff", "ad0000ff"}, {STYLE_ID + "4", "1.5", "7d005500", "ad005500", "1.5", "7d0000ff", "ad0000ff"}, {STYLE_ID + "5", "1.5", "7d000055", "ad000055", "1.5", "7d0000ff", "ad0000ff"},};
    2.10  
    2.11  	/**
    2.12  	 * The underlying XML formatter.
    2.13 @@ -268,8 +267,7 @@
    2.14  			//write each polygon in separate placemarks
    2.15  			for(String polygon : polygons)
    2.16  			{
    2.17 -				xmlWriter.startTag(PLACEMARK_TAG);
    2.18 -				xmlWriter.textElement(NAME_TAG, GEOMETRY_NAME + polygons.indexOf(polygon)%(numOfStyles-2) + "_" + ngeometries);			
    2.19 +				xmlWriter.startTag(PLACEMARK_TAG);			
    2.20  				xmlWriter.textElement("styleUrl", "#" + styles[polygons.indexOf(polygon)%(numOfStyles-2)][0]);
    2.21  
    2.22  				xmlWriter.startTag(MULTIGEOMETRY);
    2.23 @@ -283,8 +281,8 @@
    2.24  			//also write them in the same placemarks
    2.25  			
    2.26  			xmlWriter.startTag(PLACEMARK_TAG);
    2.27 -			xmlWriter.textElement(NAME_TAG, GEOMETRY_NAME + ngeometries + "_" + ngeometries);			
    2.28 -			xmlWriter.textElement("styleUrl", "#" + styles[numOfStyles-1][0]);
    2.29 +			xmlWriter.textElement(NAME_TAG, GEOMETRY_NAME);
    2.30 +			xmlWriter.textElement("styleUrl", "#" + styles[(numOfStyles-1)][0]);
    2.31  			
    2.32  			xmlWriter.startTag(MULTIGEOMETRY);
    2.33  			for(String polygon : polygons)
    2.34 @@ -406,7 +404,7 @@
    2.35  				polygon=baos.toString().substring(38).replaceAll(" xmlns:kml=\"http://earth.google.com/kml/2.1\"", "").replaceAll("kml:", "");
    2.36  				
    2.37  				/*get the polygon from the kml*/
    2.38 -				polygon=polygon.substring(polygon.indexOf("<Polygon>"), polygon.indexOf("</MultiGeometry>"));
    2.39 +				polygon=polygon.substring(polygon.indexOf("<Polygon>"), polygon.indexOf("</Polygon>")+10);
    2.40  				baos.reset();
    2.41  			}
    2.42  		}