[simile-widgets] r2245 committed - Bugfixes: info-window for click on polylines, inappropriate use of bor...

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 29, 2012, 1:02:49 AM1/29/12
to simile-wi...@googlegroups.com
Revision: 2245
Author: david.karger
Date: Sat Jan 28 22:02:22 2012
Log: Bugfixes: info-window for click on polylines, inappropriate use
of borderThickness to size edges of markers, timeplot conflict with
timeline localization
http://code.google.com/p/simile-widgets/source/detail?r=2245

Modified:
/exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js
/exhibit/trunk/src/webapp/api/exhibit-bundle.js
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
/exhibit/trunk/src/webapp/api/extensions/map/scripts/map-view.js
/exhibit/trunk/src/webapp/api/extensions/timeplot/timeplot-extension.js

=======================================
--- /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Thu Jan 5
11:54:51 2012
+++ /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Sat Jan 28
22:02:22 2012
@@ -3747,6 +3747,7 @@
};

Exhibit.HierarchicalFacet.prototype._internalAddSelection=function(selection){var
parentToClear={};
var childrenToClear={};
+this._buildCache();
var cache=this._cache;
var markClearAncestors=function(value){if(value in
cache.valueToParent){var parents=cache.valueToParent[value];
for(var i=0;
=======================================
--- /exhibit/trunk/src/webapp/api/exhibit-bundle.js Thu Jan 5 11:54:51 2012
+++ /exhibit/trunk/src/webapp/api/exhibit-bundle.js Sat Jan 28 22:02:22 2012
@@ -3747,6 +3747,7 @@
};
Exhibit.HierarchicalFacet.prototype._internalAddSelection=function(G){var
F={};
var I={};
+this._buildCache();
var A=this._cache;
var E=function(N){if(N in A.valueToParent){var K=A.valueToParent[N];
for(var L=0;
=======================================
---
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
Sat Dec 31 22:23:44 2011
+++
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
Sat Jan 28 22:02:22 2012
@@ -18,7 +18,7 @@
}};
uiContext.getCollection().addListener(this._listener);
};
-Exhibit.MapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:[20,0],dimensions:2},"zoom":{type:"float",defaultValue:2},"autoposition":{type:"boolean",defaultValue:false},"scrollWheelZoom":{type:"boolean",defaultValue:true},"size":{type:"text",defaultValue:"small"},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"normal",choices:["normal","satellite","hybrid"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true}};
+Exhibit.MapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:[20,0],dimensions:2},"zoom":{type:"float",defaultValue:2},"autoposition":{type:"boolean",defaultValue:false},"scrollWheelZoom":{type:"boolean",defaultValue:true},"size":{type:"text",defaultValue:"small"},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"normal",choices:["normal","satellite","hybrid","terrain"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true}};

Exhibit.MapView._accessorSpecs=[{accessorName:"getProxy",attributeName:"proxy"},{accessorName:"getLatlng",alternatives:[{bindings:[{attributeName:"latlng",types:["float","float"],bindingNames:["lat","lng"]},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]},{bindings:[{attributeName:"lat",type:"float",bindingName:"lat"},{attributeName:"lng",type:"float",bindingName:"lng"},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]}]},{accessorName:"getPolygon",attributeName:"polygon",type:"text"},{accessorName:"getPolyline",attributeName:"polyline",type:"text"},{accessorName:"getColorKey",attributeName:"marker",type:"text"},{accessorName:"getColorKey",attributeName:"colorKey",type:"text"},{accessorName:"getSizeKey",attributeName:"sizeKey",type:"text"},{accessorName:"getIconKey",attributeName:"iconKey",type:"text"},{accessorName:"getIcon",attributeName:"icon",type:"url"}];
Exhibit.MapView._initialize=function(){var links=[];
var heads=document.documentElement.getElementsByTagName("head");
@@ -326,14 +326,14 @@

Exhibit.MapView.prototype._plotPolyline=function(itemID,polylineString,color,makeLatLng){var
coords=this._parsePolygonOrPolyline(polylineString,makeLatLng);
if(coords.length>1){var settings=this._settings;
var borderColor=settings.borderColor!=null?settings.borderColor:color;
-var polyline=new
google.maps.Polyline({path:coords,strokeColor:borderColor,strokeWidth:settings.borderWidth,strokeOpacity:settings.borderOpacity});
+var polyline=new
google.maps.Polyline({path:coords,strokeColor:borderColor,strokeWeight:settings.borderWidth,strokeOpacity:settings.borderOpacity});
return this._addPolygonOrPolyline(itemID,polyline);
}return null;
};

Exhibit.MapView.prototype._addPolygonOrPolyline=function(itemID,poly){poly.setMap(this._map);
this._overlays.push(poly);
var self=this;
-var onclick=function(latlng){self._showInfoWindow([itemID],latlng);
+var onclick=function(event){self._showInfoWindow([itemID],event.latLng);

if(self._selectListener!=null){self._selectListener.fire({itemIDs:[itemID]});
}};
google.maps.event.addListener(poly,"click",onclick);
@@ -380,8 +380,8 @@
var pin=settings.pin;
var pinWidth=settings.pinWidth;
var pinHeight=settings.pinHeight;
-var lineWidth=settings.borderWidth;
-var lineColor=settings.borderColor;
+var lineWidth=1;
+var lineColor=settings.borderColor||"black";
var alpha=settings.shapeAlpha;
var bodyWidth=width-lineWidth;
var bodyHeight=height-lineWidth;
@@ -444,7 +444,7 @@
context.textBaseline="middle";
context.textAlign="center";
context.globalAlpha=1;
-context.fillStyle=lineColor;
+context.fillStyle="black";
context.fillText(label,width/2,height/2,width/1.4);
}return{iconURL:canvas.toDataURL(),shadowURL:shadow.toDataURL()};
};
=======================================
--- /exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
Sat Dec 31 22:23:44 2011
+++ /exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
Sat Jan 28 22:02:22 2012
@@ -18,7 +18,7 @@
}};
B.getCollection().addListener(this._listener);
};
-Exhibit.MapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:[20,0],dimensions:2},"zoom":{type:"float",defaultValue:2},"autoposition":{type:"boolean",defaultValue:false},"scrollWheelZoom":{type:"boolean",defaultValue:true},"size":{type:"text",defaultValue:"small"},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"normal",choices:["normal","satellite","hybrid"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true}};
+Exhibit.MapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:[20,0],dimensions:2},"zoom":{type:"float",defaultValue:2},"autoposition":{type:"boolean",defaultValue:false},"scrollWheelZoom":{type:"boolean",defaultValue:true},"size":{type:"text",defaultValue:"small"},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"normal",choices:["normal","satellite","hybrid","terrain"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true}};

Exhibit.MapView._accessorSpecs=[{accessorName:"getProxy",attributeName:"proxy"},{accessorName:"getLatlng",alternatives:[{bindings:[{attributeName:"latlng",types:["float","float"],bindingNames:["lat","lng"]},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]},{bindings:[{attributeName:"lat",type:"float",bindingName:"lat"},{attributeName:"lng",type:"float",bindingName:"lng"},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]}]},{accessorName:"getPolygon",attributeName:"polygon",type:"text"},{accessorName:"getPolyline",attributeName:"polyline",type:"text"},{accessorName:"getColorKey",attributeName:"marker",type:"text"},{accessorName:"getColorKey",attributeName:"colorKey",type:"text"},{accessorName:"getSizeKey",attributeName:"sizeKey",type:"text"},{accessorName:"getIconKey",attributeName:"iconKey",type:"text"},{accessorName:"getIcon",attributeName:"icon",type:"url"}];
Exhibit.MapView._initialize=function(){var B=[];
var G=document.documentElement.getElementsByTagName("head");
@@ -326,14 +326,14 @@
Exhibit.MapView.prototype._plotPolyline=function(E,H,B,F){var
D=this._parsePolygonOrPolyline(H,F);
if(D.length>1){var C=this._settings;
var G=C.borderColor!=null?C.borderColor:B;
-var A=new
google.maps.Polyline({path:D,strokeColor:G,strokeWidth:C.borderWidth,strokeOpacity:C.borderOpacity});
+var A=new
google.maps.Polyline({path:D,strokeColor:G,strokeWeight:C.borderWidth,strokeOpacity:C.borderOpacity});
return this._addPolygonOrPolyline(E,A);
}return null;
};

Exhibit.MapView.prototype._addPolygonOrPolyline=function(D,C){C.setMap(this._map);
this._overlays.push(C);
var A=this;
-var B=function(E){A._showInfoWindow([D],E);
+var B=function(E){A._showInfoWindow([D],E.latLng);
if(A._selectListener!=null){A._selectListener.fire({itemIDs:[D]});
}};
google.maps.event.addListener(C,"click",B);
@@ -380,8 +380,8 @@
var M=W.pin;
var O=W.pinWidth;
var H=W.pinHeight;
-var A=W.borderWidth;
-var D=W.borderColor;
+var A=1;
+var D=W.borderColor||"black";
var I=W.shapeAlpha;
var Z=S-A;
var R=Q-A;
@@ -444,7 +444,7 @@
E.textBaseline="middle";
E.textAlign="center";
E.globalAlpha=1;
-E.fillStyle=D;
+E.fillStyle="black";
E.fillText(N,S/2,Q/2,S/1.4);
}return{iconURL:F.toDataURL(),shadowURL:L.toDataURL()};
};
=======================================
--- /exhibit/trunk/src/webapp/api/extensions/map/scripts/map-view.js Sat
Dec 31 22:23:44 2011
+++ /exhibit/trunk/src/webapp/api/extensions/map/scripts/map-view.js Sat
Jan 28 22:02:22 2012
@@ -46,7 +46,7 @@
"size": { type: "text", defaultValue: "small" },
"scaleControl": { type: "boolean", defaultValue: true },
"overviewControl": { type: "boolean", defaultValue: false },
- "type": { type: "enum", defaultValue: "normal",
choices: [ "normal", "satellite", "hybrid" ] },
+ "type": { type: "enum", defaultValue: "normal",
choices: [ "normal", "satellite", "hybrid", "terrain" ] },
"bubbleTip": { type: "enum", defaultValue: "top",
choices: [ "top", "bottom" ] },
"mapHeight": { type: "int", defaultValue: 400 },
"mapConstructor": { type: "function", defaultValue: null },
@@ -629,7 +629,6 @@
self._settings
);

-// marker=new google.maps.Marker({position: point, map: self._map});
google.maps.event.addListener(marker, "click", function() {
self._showInfoWindow(locationData.items,null,marker)

@@ -782,7 +781,7 @@
var polyline = new google.maps.Polyline({
path: coords,
strokeColor: borderColor,
- strokeWidth: settings.borderWidth,
+ strokeWeight: settings.borderWidth,
strokeOpacity: settings.borderOpacity
});

@@ -796,8 +795,8 @@
this._overlays.push(poly);

var self = this;
- var onclick = function(latlng) {
- self._showInfoWindow([itemID],latlng);
+ var onclick = function(event) {
+ self._showInfoWindow([itemID],event.latLng);

if (self._selectListener != null) {
self._selectListener.fire({ itemIDs: [itemID] });
@@ -878,8 +877,8 @@
var pin=settings.pin;
var pinWidth=settings.pinWidth;
var pinHeight=settings.pinHeight;
- var lineWidth=settings.borderWidth;
- var lineColor=settings.borderColor;
+ var lineWidth=1; //maybe settings.borderWidth but may clash with
polyline width usage
+ var lineColor=settings.borderColor || "black";
var alpha=settings.shapeAlpha;
var bodyWidth=width-lineWidth; //stroke is half outside circle on both
sides
var bodyHeight=height-lineWidth;
@@ -975,7 +974,7 @@
context.textBaseline="middle";
context.textAlign="center";
context.globalAlpha=1;
- context.fillStyle=lineColor;
+ context.fillStyle="black";
context.fillText(label,width/2.0,height/2.0,width/1.4);
}

=======================================
--- /exhibit/trunk/src/webapp/api/extensions/timeplot/timeplot-extension.js
Tue Oct 13 13:08:51 2009
+++ /exhibit/trunk/src/webapp/api/extensions/timeplot/timeplot-extension.js
Sat Jan 28 22:02:22 2012
@@ -46,7 +46,9 @@
// Allowing these separate pieces to load on their own
// results in backwards order in IE. Forcing the correct
// order is heavy handed but works.
- var scriptURLs =
[ "http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true", "http://api.simile-widgets.org/timeline/2.3.1/timeline-bundle.js", "http://trunk.simile-widgets.org/timeplot/api/timeplot-api.js?bundle=true", "http://trunk.simile-widgets.org/timeplot/api/timeplot-bundle.js"
];
+ // Karger adds: actually, it breaks timeline.
+ //var scriptURLs =
[ "http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true", "http://api.simile-widgets.org/timeline/2.3.1/timeline-bundle.js", "http://trunk.simile-widgets.org/timeplot/api/timeplot-api.js?bundle=true", "http://trunk.simile-widgets.org/timeplot/api/timeplot-bundle.js"
];
+ var scriptURLs =
["http://api.simile-widgets.org/timeplot/1.1/timeplot-api.js" ];
var cssURLs = [];

if (Exhibit.TimeplotExtension.params.bundle) {
Reply all
Reply to author
Forward
0 new messages