Changeset 6551 in main
- Timestamp:
- 06/18/14 18:18:43 (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ibisph-view/src/main/webapp/js/jquery.leaflet.js
r6514 r6551 5 5 * @version: 1.0 6 6 * 7 8 not sure makes sense to loop... 9 see: http://pioul.fr/architecture-of-a-multi-instantiable-jquery-plugin about setting up plugin to handle 10 mulitple maps/page. 11 7 12 * @ Usage: $("#map").leaflet(); 8 13 *---------------------------------------------------------------------------*/ … … 267 272 // color to be used for values that do NOT fall within the 268 273 // start/end values. 274 ,reverseColors: false 269 275 ,areaColor: 270 276 [ … … 297 303 $.getJSON( getCompleteURL(config.choropleth.geoJSON.url), init); 298 304 305 // add the config to the data 306 $(this).data("leaflet", config); 307 299 308 // main init method either called via the json ajax callback or called 300 309 // directly if the config has a non null geojson data property. … … 550 559 "<h4 class='legend-label'>" 551 560 + "<i class=\"legend-i\" style=\"background-color: " 552 + config.choropleth.areaColor[config.choropleth.dataClasses.numberOfGroups][i]561 + getChoroplethColor(i) 553 562 + "\"></i>" 554 563 + getDataClassesRangeTitle(i) … … 636 645 return(config.choropleth.areaColor[0][0] ); 637 646 } 647 else if(config.choropleth.reverseColors) 648 { 649 var length = config.choropleth.areaColor[config.choropleth.dataClasses.numberOfGroups].length; 650 return(config.choropleth.areaColor[config.choropleth.dataClasses.numberOfGroups][length-dataClassIndex]); 651 } 652 638 653 return(config.choropleth.areaColor[config.choropleth.dataClasses.numberOfGroups][dataClassIndex]); 639 654 }; //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~ … … 809 824 return L.marker(latlng, { 810 825 icon: L.divIcon({ 811 className: 'marker-'+feature.properties.amenity ,812 html: iconByName(feature.properties.amenity),813 iconUrl: '../images/markers/'+feature.properties.amenity+'.png',814 iconSize: [25, 41],815 iconAnchor: [12, 41],816 popupAnchor: [1, -34],817 shadowSize: [41,41]826 className: 'marker-'+feature.properties.amenity 827 ,html: iconByName(feature.properties.amenity) 828 ,iconUrl: '../images/markers/'+feature.properties.amenity+'.png' 829 ,iconSize: [25, 41] 830 ,iconAnchor: [12, 41] 831 ,popupAnchor: [ 1, -34] 832 ,shadowSize: [41, 41] 818 833 }) 819 834 }); … … 838 853 }; //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~ 839 854 855 $.fn.leaflet.setReverseColors = function(reverseColors) 856 { 857 config.choropleth.reverseColors = reverseColors; 858 setupChoroplethValuesAndLegend(); 859 return(this); 860 }; //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~ 840 861 841 862 return(this); -
trunk/ibisph-view/src/main/webapp/xslt/html/ContentContainer.xslt
r6461 r6551 258 258 <xsl:variable name="id" select="if(string-length($controlID) != 0) then $controlID else concat('expandableContentControl.', generate-id($content))"/> 259 259 <xsl:variable name="controlType" select="if(string-length($controlType) != 0) then $controlType else 'checkbox'"/> 260 <!-- 261 <xsl:if test="string-length($content) != 0"> 262 --> 260 261 <xsl:if test="exists($content/*) or (string-length($content) != 0)"> 263 262 <xsl:if test="string-length($jumpToName) != 0"><a name="{$jumpToName}"/></xsl:if> 264 263 <div class="ExpandableContent {$additionalClasses}"> … … 307 306 </div> 308 307 </div> 309 <!--310 308 </xsl:if> 311 -->312 309 </xsl:template> 313 310 -
trunk/ibisph-view/src/main/webapp/xslt/html/LeafletMapGraphic.xslt
r6541 r6551 77 77 </select> 78 78 79 <label for="mapReverseColors">Reverse Colors: </label> 80 <input id="mapReverseColors" type="checkbox" value="true"/> 81 79 82 <div class="Graphic Map"> 80 83 <div id="{$mapContainerID}"></div> -
trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/Indicator.xslt
r6457 r6551 91 91 <xsl:param name="content"/> 92 92 <xsl:param name="description"/> 93 <xsl:param name="addWikiAttribute" select="true()" />94 95 <xsl:param name="contentBlockType" select="$Indicator.contentBlockType" ibis:doc="Optional param to control the block type. Default is ContentContainer.contentBlockType."/>96 <xsl:param name="expandableControlType" select="'checkbox'"ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/>97 <xsl:param name="expandableContentShow" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/>98 <xsl:param name="expandableControlName" 93 <xsl:param name="addWikiAttribute" select="true()" tunnel="yes"/> 94 95 <xsl:param name="contentBlockType" tunnel="yes" select="$Indicator.contentBlockType" ibis:doc="Optional param to control the block type. Default is ContentContainer.contentBlockType."/> 96 <xsl:param name="expandableControlType" tunnel="yes" select="'checkbox'" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> 97 <xsl:param name="expandableContentShow" tunnel="yes" ibis:doc="Optional value passed to expandable template if contentBlockType is 'expandable'."/> 98 <xsl:param name="expandableControlName" tunnel="yes" 99 99 ibis:doc="Optional param that is only needed when the expandableControlType 100 100 is 'radio'. This results in a UI where only 1 expandable block … … 241 241 </xsl:if> 242 242 </xsl:with-param> 243 </xsl:call-template>243 </xsl:call-template> 244 244 </xsl:if> 245 245 </xsl:template> … … 343 343 <xsl:param name="indicator" select="$indicator"/> 344 344 <xsl:call-template name="Indicator.contentBlock"> 345 <xsl:with-param name="title" select="' OtherProgram Information'"/>345 <xsl:with-param name="title" select="'Health Program Information'"/> 346 346 <xsl:with-param name="content" select="$indicator/OTHER_PROGRAM_INFORMATION"/> 347 347 <xsl:with-param name="description" select="'Additional information that does not fit into any of the above categories'"/> … … 410 410 <xsl:param name="indicatorDataNote" ibis:doc="Optional indicator data note text."/> 411 411 <xsl:param name="indicatorViewDataNote" ibis:doc="Optional indicator view data note text."/> 412 <xsl:param name="title" select="'Data Notes'"/> 412 413 413 414 <xsl:variable name="text"> … … 423 424 424 425 <xsl:call-template name="Indicator.contentBlock"> 425 <xsl:with-param name="title" select=" 'Data Notes'"/>426 <xsl:with-param name="title" select="$title"/> 426 427 <xsl:with-param name="content" select="$text"/> 427 428 <xsl:with-param name="description" select="'Important metadata and data notes about this indicators data'"/> -
trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/view_complete/Page.xslt
r6487 r6551 33 33 </xsl:param> 34 34 35 <xsl:param name="Indicator.contentBlockType" select="'fixed'"/> 36 35 37 36 38 <xsl:template name="Page.sectionsContent" 37 39 ibis:doc="Main page content template." 38 40 > 41 42 <xsl:call-template name="Indicator.whyImportant"> 43 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 44 <xsl:with-param name="expandableContentShow" tunnel="yes" select="true()"/> 45 </xsl:call-template> 46 39 47 <xsl:if test="$Graphic.datasetMapable"> 40 48 <xsl:call-template name="Indicator.contentBlock"> 41 <xsl:with-param name="title" select=" 'Map'"/>49 <xsl:with-param name="title" select="concat($indicatorView/DATASET_CATEGORY/LABEL, ' ', $indicatorView/TITLE, ' Map')"/> 42 50 <xsl:with-param name="content"> 43 51 <xsl:call-template name="Graphic.indicatorViewMap"> … … 46 54 </xsl:call-template> 47 55 </xsl:with-param> 48 <xsl:with-param name="expandableContentShow" select="true()"/> 49 <xsl:with-param name="addWikiAttribute" select="false()"/> 56 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 57 <xsl:with-param name="expandableContentShow" tunnel="yes" select="true()"/> 58 <xsl:with-param name="addWikiAttribute" tunnel="yes" select="false()"/> 59 <xsl:with-param name="description" select="'Choropleth/thematic map.'"/> 50 60 </xsl:call-template> 51 61 </xsl:if> 52 62 53 63 <xsl:call-template name="Indicator.contentBlock"> 54 <xsl:with-param name="title" select=" 'Chart'"/>64 <xsl:with-param name="title" select="concat($indicatorView/TITLE, ' Chart')"/> 55 65 <xsl:with-param name="content"> 56 66 <xsl:call-template name="Graphic.indicatorViewChart"> … … 59 69 </xsl:call-template> 60 70 </xsl:with-param> 61 <xsl:with-param name="expandableContentShow" select="true()"/> 62 <xsl:with-param name="addWikiAttribute" select="false()"/> 63 </xsl:call-template> 64 65 <xsl:call-template name="Indicator.contentBlock"> 66 <xsl:with-param name="title" select="'Data'"/> 67 <xsl:with-param name="content"> 68 <xsl:call-template name="Graphic.indicatorViewGrid"> 69 <xsl:with-param name="indicatorView" select="$indicatorView"/> 70 <xsl:with-param name="urlSuffix" select="if(string-length($xmlURL) != 0)then concat('?xmlURL=', $xmlURL) else ''"/> 71 </xsl:call-template> 72 </xsl:with-param> 73 <xsl:with-param name="expandableContentShow" select="true()"/> 74 <xsl:with-param name="addWikiAttribute" select="false()"/> 71 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 72 <xsl:with-param name="expandableContentShow" tunnel="yes" select="true()"/> 73 <xsl:with-param name="addWikiAttribute" tunnel="yes" select="false()"/> 75 74 </xsl:call-template> 76 75 … … 82 81 </xsl:call-template> 83 82 </xsl:with-param> 83 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 84 <xsl:with-param name="addWikiAttribute" tunnel="yes" select="false()"/> 84 85 </xsl:call-template> 85 86 86 87 <xsl:call-template name="Indicator.contentBlock"> 87 <xsl:with-param name="title" select="'Chart Narrative'"/> 88 <xsl:with-param name="content" select="$indicatorView/CHART_NARRATIVE"/> 89 <xsl:with-param name="description" select="'Additional chart data information.'"/> 88 <xsl:with-param name="title" select="'Data Table'"/> 89 <xsl:with-param name="content"> 90 <xsl:call-template name="Graphic.indicatorViewGrid"> 91 <xsl:with-param name="indicatorView" select="$indicatorView"/> 92 <xsl:with-param name="urlSuffix" select="if(string-length($xmlURL) != 0)then concat('?xmlURL=', $xmlURL) else ''"/> 93 </xsl:call-template> 94 </xsl:with-param> 95 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 96 <xsl:with-param name="expandableContentShow" tunnel="yes" select="true()"/> 97 <xsl:with-param name="addWikiAttribute" tunnel="yes" select="false()"/> 90 98 </xsl:call-template> 91 99 92 <xsl:call-template name="Indicator.dataNotes"> 93 <xsl:with-param name="indicatorDataNote" select="$indicator/DATA_NOTE"/> 94 <xsl:with-param name="indicatorViewDataNote" select="$indicatorView/DATA_NOTE"/> 100 101 <xsl:call-template name="Indicator.contentBlock"> 102 <xsl:with-param name="title" select="'Data Notes'"/> 103 <xsl:with-param name="content"> 104 <xsl:call-template name="Indicator.dataNotes"> 105 <xsl:with-param name="title" select="'Notes'"/> 106 <xsl:with-param name="indicatorDataNote" select="$indicator/DATA_NOTE"/> 107 <xsl:with-param name="indicatorViewDataNote" select="$indicatorView/DATA_NOTE"/> 108 </xsl:call-template> 109 110 <xsl:call-template name="Indicator.dataSources"> 111 <xsl:with-param name="indicatorDataSources" select="$indicator/DATA_SOURCES"/> 112 <xsl:with-param name="indicatorViewDataSources" select="$indicatorView/DATA_SOURCES"/> 113 </xsl:call-template> 114 115 <xsl:call-template name="Indicator.dataIssues"/> 116 </xsl:with-param> 117 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 118 <xsl:with-param name="description" select="'Metadata for this health indicator.'"/> 95 119 </xsl:call-template> 96 120 97 <xsl:call-template name="Indicator.dataSources"> 98 <xsl:with-param name="indicatorDataSources" select="$indicator/DATA_SOURCES"/> 99 <xsl:with-param name="indicatorViewDataSources" select="$indicatorView/DATA_SOURCES"/> 121 122 <xsl:call-template name="Indicator.contentBlock"> 123 <xsl:with-param name="title" select="'Health Indicator Definition'"/> 124 <xsl:with-param name="content"> 125 <xsl:call-template name="Indicator.definition"/> 126 <xsl:call-template name="Indicator.numerator"/> 127 <xsl:call-template name="Indicator.denominator"/> 128 </xsl:with-param> 129 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 130 <xsl:with-param name="description" select="'What defines this health indicator.'"/> 100 131 </xsl:call-template> 101 132 102 <xsl:call-template name="Indicator.definition"/>103 133 104 <xsl:call-template name="Indicator.numerator"/> 105 <xsl:call-template name="Indicator.denominator"/> 134 <xsl:call-template name="Indicator.contentBlock"> 135 <xsl:with-param name="title" select="'Health Objectives and Targets'"/> 136 <xsl:with-param name="content"> 137 <xsl:call-template name="Indicator.healthyPeopleObjective"/> 138 <xsl:call-template name="Indicator.otherObjectives"/> 139 </xsl:with-param> 140 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 141 <xsl:with-param name="description" select="'Goals and objectives for this health indicator.'"/> 142 </xsl:call-template> 106 143 107 <xsl:call-template name="Indicator.dataIssues"/> 144 <xsl:call-template name="Indicator.contentBlock"> 145 <xsl:with-param name="title" select="'Current Outlook'"/> 146 <xsl:with-param name="content"> 147 <xsl:call-template name="Indicator.howDoing"/> 148 <xsl:call-template name="Indicator.howCompare"/> 149 </xsl:with-param> 150 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 151 <xsl:with-param name="description" select="'How are we doing, how do we compare.'"/> 152 </xsl:call-template> 108 153 109 <xsl:call-template name="Indicator.whyImportant"/> 154 <xsl:call-template name="Indicator.contentBlock"> 155 <xsl:with-param name="title" select="'Health Improvement Resources'"/> 156 <xsl:with-param name="content"> 157 <xsl:call-template name="Indicator.whatDoing"/> 158 <xsl:call-template name="Indicator.evidenceBasedPractices"/> 159 <xsl:call-template name="Indicator.availableServices"/> 160 <xsl:call-template name="Indicator.otherInformation"/> 161 </xsl:with-param> 162 <xsl:with-param name="contentBlockType" tunnel="yes" select="'expandable'"/> 163 <xsl:with-param name="description" select="'Other related information and resources.'"/> 164 </xsl:call-template> 110 165 111 <xsl:call-template name="Indicator.healthyPeopleObjective"/> 112 <xsl:call-template name="Indicator.otherObjectives"/> 113 114 <xsl:call-template name="Indicator.howDoing"/> 115 <xsl:call-template name="Indicator.howCompare"/> 116 <xsl:call-template name="Indicator.whatDoing"/> 117 <xsl:call-template name="Indicator.evidenceBasedPractices"/> 118 119 <xsl:call-template name="Indicator.availableServices"/> 120 <xsl:call-template name="Indicator.otherInformation"/> 121 122 <br/><br/> 166 <br/> 123 167 <xsl:call-template name="Indicator.allDates"/> 124 168 </xsl:template> -
trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/view_complete/SiteSpecific.xslt
r6541 r6551 22 22 </ibis:doc> 23 23 24 25 <xsl:param name="ContentContainer.contentBlockType" select="'expandable'"/>26 24 27 25 <xsl:param name="SiteSpecific.leafletOptionsJSON" select="'{}'" … … 124 122 // has to all be within the ready because the elements *MIGHT* not be defined in the DOM... 125 123 // another solution is to simply have the xslt build the options and then pass the options... 126 var kendoChart; 124 var $kendoChart; 125 var $leafletMap; 127 126 $(document).ready(function() 128 127 { … … 130 129 131 130 $("#grid").kendoGrid(baseKendoGridOptionsJSON); 132 kendoChart = $("#chart").kendoChart(baseKendoChartOptionsJSON);131 $kendoChart = $("#chart").kendoChart(baseKendoChartOptionsJSON); 133 132 kendoDataSource.read(); // have to have after grid and chart because .autoBind = false. 134 133 135 134 <xsl:if test="$Graphic.datasetMapable"> 136 leafletMap = $("#map").leaflet($.extend(siteSpecificLeafletOptionsJSON, requestSpecificLeafletOptionsJSON)); 137 $("#mapDataClassesCount").change(function () { $("#map").leaflet.setDataClassesCount(this.value); }); 138 $("#mapDataClassesType").change(function () { $("#map").leaflet.setDataClassesType(this.value); }); 135 $leafletMap = $("#map").leaflet($.extend(siteSpecificLeafletOptionsJSON, requestSpecificLeafletOptionsJSON)); 136 $("#mapDataClassesCount").change(function () { $leafletMap.leaflet.setDataClassesCount(this.value); }); 137 $("#mapDataClassesType") .change(function () { $leafletMap.leaflet.setDataClassesType(this.value); }); 138 $("#mapReverseColors") .change(function () { $leafletMap.leaflet.setReverseColors(this.checked); }); 139 139 </xsl:if> 140 140 … … 144 144 function getChartImage() 145 145 { 146 var svg = kendoChart.data("kendoChart").svg(); 146 // doesn't var svg = $kendoChart.kendoChart.svg(); 147 // works var svg = $kendoChart.data("kendoChart").svg(); 148 var svg = $kendoChart.getKendoChart().svg(); 147 149 getImage(svg); 148 150 }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 151 153 function getMapImage() 152 154 { 155 console.log("chart: " + $kendoChart.data("kendoChart")); 156 console.log("leaflet: " + $leafletMap.data("leaflet")); 153 157 <![CDATA[ 154 var svg = "<?xml version='1.0'?>" + $(".leaflet-overlay-pane").html(); 155 svg = svg.replace("<?xml version='1.0'?><svg", "<?xml version='1.0'?><svg xmlns='http://www.w3.org/2000/svg' version='1.1' "); 158 // xml declaration is NOT needed... 159 var svg = "START_MARKER" + $(".leaflet-overlay-pane").html(); 160 svg = svg.replace("START_MARKER<svg", "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' "); 156 161 getImage(svg); 157 162 ]]> … … 162 167 { 163 168 //svg = $(svg).replaceAll("stroke=''", ""); 164 alert("SVG: " +svg);169 //alert("SVG: " +svg); 165 170 166 171 this.xhr = $.ajax({ 167 172 type: "POST" 168 ,url: " http://localhost/ibisph-view/svgtoimage/download.png"173 ,url: "<xsl:value-of select="$ibis.urlPrefix"/>svgtoimage/download.png" 169 174 ,crossDomain: true 170 175 ,headers: { … … 182 187 console.log("Converting SVG to Image - ERROR: "+ errorThrown+", Status: ", textStatus); 183 188 } 184 //,dataType: "xml"189 // breaks things... ,dataType: "xml" 185 190 }); 186 191 }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/ibisph/src/main/java/org/ibisph/web/servlet/SVGToRasterServlet.java
r6541 r6551 55 55 // int width = 130; 56 56 57 // needed to convert to w3c document to get around any weird null attribute58 // stuff. If inputstream used it throws on blank attributes. Other options59 // are to test and screen svg content either on the client or backend.57 // Transcoder input can be stream, document, reader, or URI. Since it needs 58 // to be converted, might as well do a w3c document and get it where it will 59 // eventually end up with ability to show the offending SVG if issue. 60 60 // InputStream inputStream = new ByteArrayInputStream(svg.getBytes()); 61 61 Document document = null; … … 85 85 } 86 86 87 // Note that some kendo charts have blank stroke attributes. This causes 88 // errors to be logged but does not result in runtime stoppage. Other options 89 // are to test and screen svg content either on the client or before trans. 87 90 try { 88 91 transcoder.transcode(transcoderInput, transcoderOutput);
Note: See TracChangeset
for help on using the changeset viewer.