From 9a810d3531a3e8b4d715246303311208df60f935 Mon Sep 17 00:00:00 2001 From: Josemar Date: Thu, 29 Jun 2017 14:46:03 -0300 Subject: [PATCH 01/15] Adicionado novas funcionalidade no plugin --- GMapComponentAsyncLoader.js | 40 +- component.xml | 915 ++++++++++++++++----- gmapsoverlay-implementation.js | 1377 ++++++++++++++++++++------------ gmapsoverlay.css | 110 ++- 4 files changed, 1736 insertions(+), 706 deletions(-) diff --git a/GMapComponentAsyncLoader.js b/GMapComponentAsyncLoader.js index b58c934..2eee728 100644 --- a/GMapComponentAsyncLoader.js +++ b/GMapComponentAsyncLoader.js @@ -1,10 +1,34 @@ -/* -This Source Code Form is subject to the -terms of the Mozilla Public License, v. 2.0. -If a copy of the MPL was not distributed -with this file, You can obtain one at -http://mozilla.org/MPL/2.0/. +/*! +* JavaScript - loadGoogleMaps( version, apiKey, language ) +* +* - Load Google Maps API using jQuery Deferred. +* Useful if you want to only load the Google Maps API on-demand. +* - Requires jQuery 1.5 +* +* Copyright (c) 2011 Glenn Baker +* Dual licensed under the MIT and GPL licenses. +* +* The MIT License (MIT) +* Copyright (c) 2011 Glenn Baker +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: + +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. + +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. */ + var loadGoogleMapsOverlay = (function($) { var now = $.now(), promise; @@ -85,7 +109,7 @@ var loadGoogleMapsOverlay = (function($) { $.ajax({ dataType: 'script', data: params, - url: 'http://maps.googleapis.com/maps/api/js' + url: "http://maps.googleapis.com/maps/api/js" }); } @@ -96,4 +120,4 @@ var loadGoogleMapsOverlay = (function($) { }; -} (jQuery)); \ No newline at end of file +} (jQuery)); diff --git a/component.xml b/component.xml index 08524e7..abc9224 100644 --- a/component.xml +++ b/component.xml @@ -1,203 +1,716 @@ + -
- Google Maps Overlay Component - gMapsOverlayComponent - Google Maps Overlay Component (By Kleyson Rios) - COMMUNITYCOMPONENTS - Community Contributions - PalleteEntry - 2.0 -
- - - width - height - executeAtStart - htmlObject - listeners - postFetch - preExecution - postExecution - xActionArrayParameter - - dataSource - - mapName - mapWidth - mapHeight - centerLatitude - centerLongitude - defaultColor - defaultZoomLevel - legend - legendText - sourceText - search - - - - - GMapComponentAsyncLoader - - - - - - -
- mapName - BaseProperty - - Map Name - This is the region descriptor file name that must be placed at cde/components/gmapsoverlay/map-def - false - String - String - 40 - 1.0 -
-
- -
- mapHeight - BaseProperty - - Map Height - - false - Integer - Number - 40 - 1.0 -
-
- -
- mapWidth - BaseProperty - - Map Width - - false - Integer - Number - 40 - 1.0 -
-
- -
- centerLatitude - BaseProperty - - Center Latitude - Center latitude for map - false - Float - Number - 40 - 1.0 -
-
- -
- centerLongitude - BaseProperty - - Center Longitude - Center Longitude for Map - false - Float - Number - 40 - 1.0 -
-
- -
- defaultColor - BaseProperty - - Default Color - Default color for the map - false - String - String - 40 - 1.0 -
-
- -
- defaultZoomLevel - BaseProperty - 6 - Default zoom Level - - Integer - Number - 40 - false - 1.0 -
-
- -
- legend - BaseProperty - "[]" - Range for Lengend - - false - ValuesArray - Array - 40 - 1.0 -
-
- -
- legendText - BaseProperty - Legend - Legend Text - - false - String - String - 40 - 1.0 -
-
- -
- sourceText - BaseProperty - - Source Text - - false - String - String - 40 - 1.0 -
-
- -
- search - BaseProperty - "true" - Search - Enable Search Box - false - Boolean - Boolean - 40 - 1.0 -
-
-
-
-
+
+ Google Maps Overlay Component + gMapsOverlayComponent + Google Maps Overlay Component (By Kleyson Rios) + COMMUNITYCOMPONENTS + Community Contributions + PalleteEntry + 2.0 +
+ + + executeAtStart + htmlObject + listeners + postFetch + preExecution + postExecution + xActionArrayParameter + + dataSource + + mapName + mapNameConditional + mapColorConditional + legendLabelDescConditional + doubleClickAction + valueFormat + width + height + centerLatitude + centerLongitude + defaultColor + defaultZoomLevel + disableDoubleClickZoom + zoomControl + panControl + scrollwheel + exportToCSVFileVisible + exportToCSVFileLocaly + mapTypeId + mapTypeControl + legend + legendLabelDesc + legendLabelDescFonteColor + legendLabelDescOrderColor + legendLabelDescOrderColorConditional + legendLabelDescFonteSize + legendCountVisible + legendCountFonteSize + legendOpacity + legendTitle + legendPosition + legendWidth + legendVisible + icons + locality + shapeFillOpacity + shapeStrokeWeight + legendText + legendTextFonteSize + sourceText + search + isColorDefinedInDS + isContinuousMapColor + + + + + GMapComponentAsyncLoader + + + + + + +
+ mapName + BaseProperty + + MapName + This is the region descriptor file name that must be placed at cde/components/gmapsoverlay/map-def + false + String + String + 1 + 1.0 +
+
+ + +
+ mapNameConditional + BaseProperty + + MapNameConditional + Function to return the name in the json/MapName file depending on a condition + false + JavaScript + Function + 1 + 1.0 +
+
+ +
+ mapColorConditional + BaseProperty + + MapColorConditional + Conditional function that returns a color format (#FFFFFF) to color the map should be declared receiving ex parameter: function (value) {} + false + JavaScript + Function + 1 + 1.0 +
+
+ +
+ height + BaseProperty + 800 + MapHeight + if the value blank map assumes 100% of the Height + false + Integer + Number + 1 + 1.0 +
+
+ +
+ width + BaseProperty + + MapWidth + if the value blank map assumes 100% of the width + false + Integer + Number + 1 + 1.0 +
+
+ +
+ centerLatitude + BaseProperty + + CenterLatitude + Center latitude for map + false + Float + Number + 1 + 1.0 +
+
+ +
+ centerLongitude + BaseProperty + + CenterLongitude + Center Longitude for Map + false + Float + Number + 1 + 1.0 +
+
+ +
+ defaultColor + BaseProperty + #EAEAEA + DefaultColor + Default color for the map + false + String + String + 1 + 1.0 +
+
+ +
+ defaultZoomLevel + BaseProperty + 7 + ZoomLevel + level of zoom to load the map + Integer + Number + 1 + false + 1.0 +
+
+ + +
+ zoomControl + BaseProperty + true + ZoomControl + The enabled/disabled state of the Zoom control. + true + Boolean + Boolean + 1 + false + 1.0 +
+
+ +
+ panControl + BaseProperty + true + PanControl + The enabled/disabled state of the Pan control. + true + Boolean + Boolean + 1 + false + 1.0 +
+
+ +
+ scrollwheel + BaseProperty + true + Scrollwheel + If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default. + true + Boolean + Boolean + 1 + false + 1.0 +
+
+ +
+ mapTypeId + BaseProperty + terrain + MapTypeId + Identifiers for common MapTypes.(hybrid,roadmap,satellite,terrain) + true + + String + 1 + 1.0 +
+ + terrain + hybrid + roadmap + satellite + +
+ +
+ mapTypeControl + BaseProperty + false + MapTypeControl + The initial enabled/disabled state of the Map type control.. + true + Boolean + Boolean + 1 + 1.0 +
+
+ +
+ legend + BaseProperty + "[]" + RangeForLengend + + false + ValuesArray + Array + 1 + 1.0 +
+
+ +
+ icons + BaseProperty + on + LabelsIcons + show icons + true + + String + 1 + 1.0 +
+ + on + off + +
+ +
+ locality + BaseProperty + on + AdministrativeLocality + Show info Locality + true + + String + 1 + 1.0 +
+ + on + off + +
+ +
+ legendVisible + BaseProperty + false + LegendVisible + Disable/Enable legend info + false + Boolean + Boolean + 1 + 1.0 +
+
+ +
+ legendText + BaseProperty + Legend + LegendText + Description for legend + false + String + String + 1 + 1.0 +
+
+ +
+ legendTextFonteSize + BaseProperty + 12 + LegendTextFonteSize + Fonte Size for description legend + false + Integer + String + 1 + 1.0 +
+
+ +
+ shapeFillOpacity + BaseProperty + 0.6 + ShapeFillOpacity + changes the opacity map + true + Float + Number + 1 + 1.0 +
+
+ +
+ shapeStrokeWeight + BaseProperty + 0.5 + ShapeStrokeWeight + changing the thickness of the lines on the map + true + Float + Number + 1 + 1.0 +
+
+ +
+ sourceText + BaseProperty + + Legend source Text + + false + String + String + 1 + 1.0 +
+
+ +
+ search + BaseProperty + "true" + SearchVisible + Enable/Disable Search Box + false + Boolean + Boolean + 1 + 1.0 +
+
+ +
+ disableDoubleClickZoom + BaseProperty + true + DisableDoubleClickZoom + Enables/disables zoom and center on double click. Enabled by default. + true + Boolean + Boolean + 1 + false + 1.0 +
+
+ +
+ doubleClickAction + BaseProperty + + DoubleClickAction + Adds option to double click to regions on the map.It requires two parameters in input function (obj, event) + the first is clicked object and the second is the event + false + JavaScript + Function + 1 + 1.0 +
+
+ +
+ valueFormat + BaseProperty + + ValueFormat + A function that return formats the non-null values of numeric dimensions.ex: function(value) {return valueFormated} + true + JavaScript + Function + 1 + 1.0 +
+
+ +
+ isColorDefinedInDS + BaseProperty + true + IsColorDefinedInDS + Map color defined in the datasource. datasource return default is {cities or regions etc., value, color to the map pattern(#FFFFFF)} + true + Boolean + Boolean + 1 + 1.0 +
+
+ + + +
+ isContinuousMapColor + BaseProperty + false + IsContinuousMapColor + Color map continues. Necessary disable color in the datasource + true + Boolean + Boolean + 1 + 1.0 +
+
+ + +
+ exportToCSVFileVisible + BaseProperty + false + ExportToCSVFileVisible + Export data to CSV file + true + Boolean + Boolean + 1 + 1.0 +
+
+ +
+ exportToCSVFileLocaly + BaseProperty + LEGEND + ExportToCSVFileLocaly + Export CSV file locality + true + + String + 1 + 1.0 +
+ + LEGEND + MAP + +
+ +
+ legendLabelDescFonteColor + BaseProperty + '["black"]' + LegendItemLabelDescFonteColor + + false + Array + Array + 1 + 1.0 +
+
+ +
+ legendLabelDesc + BaseProperty + '[""]' + LegendItemLabelDesc + + false + Array + Array + 1 + 1.0 +
+
+ +
+ legendLabelDescConditional + BaseProperty + + LegendItemLabelDescConditional + Conditional function that must return an array with the description of the legend item + true + JavaScript + Function + 1 + 1.0 +
+
+ +
+ legendLabelDescFonteSize + BaseProperty + 12 + LegendItemLabelDescFonteSize + Font size the description of the legend item + true + Integer + String + 1 + 1.0 +
+
+ +
+ legendCountVisible + BaseProperty + false + LegendItemCountVisible + Enable / disable The Legend colors counter + true + Boolean + Boolean + 1 + 1.0 +
+
+ +
+ legendCountFonteSize + BaseProperty + 12 + LegendItemCountFonteSize + Font size of the Legend colors counter + true + Integer + String + 1 + 1.0 +
+
+ +
+ legendOpacity + BaseProperty + 0.8 + LegendOpacity + + true + String + String + 1 + 1.0 +
+
+ +
+ legendWidth + BaseProperty + auto + LegendWidth + + true + String + String + 1 + 1.0 +
+
+ +
+ legendTitle + BaseProperty + Lengend + LegendTitle + + true + String + String + 1 + 1.0 +
+
+ +
+ legendPosition + BaseProperty + BOTTOM_CENTER + LegendPosition + changes the position of the legend + true + + String + 1 + 1.0 +
+ + BOTTOM_CENTER + BOTTOM_LEFT + RIGHT_BOTTOM + +
+ +
+ legendLabelDescOrderColor + BaseProperty + '[]' + LegendItemLabelDescOrderColor + orders the position of the colors in the legend + true + Array + Array + 1 + 1.0 +
+
+ +
+ legendLabelDescOrderColorConditional + BaseProperty + + LegendItemLabelDescOrderColorConditional + Conditional function that must return an array with orders position of the colors in the legend item + true + JavaScript + Function + 1 + 1.0 +
+
+ +
+
+
diff --git a/gmapsoverlay-implementation.js b/gmapsoverlay-implementation.js index 8b167be..0e4fc36 100644 --- a/gmapsoverlay-implementation.js +++ b/gmapsoverlay-implementation.js @@ -5,7 +5,6 @@ with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - /* Contributions by Carlos Russo from Webdetails.pt @@ -16,19 +15,21 @@ Contributions by Carlos Russo from Webdetails.pt */ - function submitGeocode(input) { return function(e) { var keyCode; if (window.event) { keyCode = window.event.keyCode; - } /*else if (variable) { - keyCode = e.which; - }*/ + } + /*else if (variable) { + keyCode = e.which; + }*/ if (keyCode == 13) { - geocoder.geocode( { address: input.value }, function(results, status) { + geocoder.geocode({ + address: input.value + }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.fitBounds(results[0].geometry.viewport); } else { @@ -42,223 +43,448 @@ function submitGeocode(input) { var gMapsOverlayComponent = UnmanagedComponent.extend({ mapEngineOpts: undefined, //override this in preExec - colormap: [[0, 102, 0, 255], [255, 255 ,0,255], [255, 0,0, 255]], //RGBA - - // Get color based on a Range - getColorLegend: function (value, legendRanges) { - var qtd = Object.keys(legendRanges.ranges).length; - for (var j = 0; j < qtd; j++) { - if ((isNaN(legendRanges.ranges[j].min) && value <= legendRanges.ranges[j].max) || - (isNaN(legendRanges.ranges[j].max) && value >= legendRanges.ranges[j].min) || - (value >= legendRanges.ranges[j].min && value <= legendRanges.ranges[j].max)) { - return legendRanges.ranges[j].color; - } - } - }, - - // Get color based on Continuous Color Map + colormap: [ + [0, 102, 0, 255], + [255, 255, 0, 255], + [255, 0, 0, 255] + ], //RGBA + + // Get color based on a Range + getColorLegend: function(value, legendRanges) { + var qtd = Object.keys(legendRanges.ranges).length; + for (var j = 0; j < qtd; j++) { + if ((isNaN(legendRanges.ranges[j].min) && value <= legendRanges.ranges[j].max) || + (isNaN(legendRanges.ranges[j].max) && value >= legendRanges.ranges[j].min) || + (value >= legendRanges.ranges[j].min && value <= legendRanges.ranges[j].max)) { + return legendRanges.ranges[j].color; + } + } + }, + + + + // Get color based on Continuous Color Map getColorMap: function() { - var interpolate = function(a, b, n){ - var c = [], d=[]; + var interpolate = function(a, b, n) { + var c = [], + d = []; var k, kk, step; - for (k=0; k 2){ - myself.queryResult[item[0]].payload = item.slice(2); - } - } - - myself._parseLegend(myself.isContinuousMapColor); - + //myself.isContinuousMapColor = this.legendVisible ? $.isEmptyObject(myself.legend) : false; + var nrCols = values.metadata.length; + + var listColor = []; + var countColor; + dataResult = {}; + dataResult.resultset = []; + dataResult.metadata = values.metadata; + + for (i in values.resultset) { + var item = values.resultset[i]; + + var value; + + + + if (typeof this.valueFormat == 'function') { + value = this.valueFormat(item[1]); + }else{ + value = item[1]; + } + + dataResult.resultset.push([item[0],value]); + + + //if (nrCols < 3) // DataSet onde a legenda é baseada no valor + // { + //value = parseFloat(item[1]); + // color = ""; + // myself.isColorDefinedInDS = false; + // } else // DataSet com a 3a coluna informando qual cor utilizar, nao utilizar Legenda nem Mapa de Cor continuo para definir cor da regiao. + // { + //value = item[1]; + // color = item[2]; + // myself.isColorDefinedInDS = true; + // } + color = ""; + if(myself.isColorDefinedInDS && typeof myself.mapColorConditional != 'function'){ + if(nrCols < 3){ + + Dashboards.error("GMaps - Color not defined in the third column of the datasource."); + return + } + color = item[2]; + // por padrao do DS as cores tem que vir na 3 coluna + listColor.push(values.resultset[i][2]); + } + + if( typeof myself.mapColorConditional == 'function'){ + // passa o valor por parametro para calculo da cor condicional + color = myself.mapColorConditional(item[1]); + listColor.push(color); + } + + + myself.queryResult[item[0]] = { + 'value': value, + 'color': color + }; + + + + + if (item.length > 2) { + myself.queryResult[item[0]].payload = item.slice(2); + } + } + + listUniqColor = _.uniq(listColor); + + myself._parseLegend(myself.isContinuousMapColor); + + // patch queryResult with color information - if (myself.isContinuousMapColor) - { - var colormap = myself.getColorMap(); - var qvalues = _.map(myself.queryResult, function (q) { return q.value; }); - var minValue = _.min(qvalues), maxValue = _.max(qvalues); - var n = colormap.length; - _.each(myself.queryResult, function (v, key) { - var level = (v.value-minValue) / (maxValue - minValue); - myself.queryResult[key] = _.extend({ - level: level, - fillColor: colormap[Math.floor( level * (n-1)) ], - fillOpacity: defaultFillOpacity, - strokeWeight: defaultStrokeWeight - }, myself.queryResult[key]); - }); - } - else - { - _.each(myself.queryResult, function (v, key) { - - var color; - if (myself.isColorDefinedInDS) { - color = v.color; - } - else - { - color = myself.getColorLegend(v.value, myself.legendRanges); - } - - myself.queryResult[key] = _.extend({ - fillColor: color, - fillOpacity: defaultFillOpacity, - strokeWeight: defaultStrokeWeight - }, myself.queryResult[key]); - }); - } + if (myself.isContinuousMapColor) { + var colormap = myself.getColorMap(); + var qvalues = _.map(myself.queryResult, function(q) { + return q.value; + }); + var minValue = _.min(qvalues), + maxValue = _.max(qvalues); + var n = colormap.length; + _.each(myself.queryResult, function(v, key) { + var level = (v.value - minValue) / (maxValue - minValue); + myself.queryResult[key] = _.extend({ + level: level, + fillColor: colormap[Math.floor(level * (n - 1))], + fillOpacity: defaultFillOpacity, + strokeWeight: defaultStrokeWeight + }, myself.queryResult[key]); + }); + } else { + listCountColor=[]; + _.each(myself.queryResult, function(v, key) { + + var color; + + if (myself.isColorDefinedInDS || (typeof myself.mapColorConditional == 'function')) { + color = v.color; + for(i=0;i" + (shapeValue ? shapeValue : '-'); + + tooltipMessage: function(shapeName, shapeValue) { + var message = shapeName + "
" + (shapeValue ? shapeValue : '-'); return '
' + message + '
'; }, - - // Apenas para debug de codigo - clickCallback : function (shape, event){ + + // Apenas para debug de codigo + clickCallback: function(shape, event) { //Override this - Dashboards.log(shape.dataPayload.name + ':' + shape.dataPayload.value + ':' + shape.dataPayload.level*100 + '%'); + Dashboards.log(shape.dataPayload.name + ':' + shape.dataPayload.value + ':' + shape.dataPayload.level * 100 + '%'); }, - - // Apenas para debug, mostra Lat/Lng no console - displayCoordinates: function(pnt) { - var lat = pnt.lat(); - lat = lat.toFixed(4); - var lng = pnt.lng(); - lng = lng.toFixed(4); - Dashboards.log("Lat: " + lat + " Lng: " + lng); - }, - - showInfo: function (event, mapEngine, infowindow) { - mapEngine.opened_info.close(); - //if (mapEngine.opened_info.name != infowindow.name) { - infowindow.setPosition(event.latLng); - infowindow.open(mapEngine.map); - mapEngine.opened_info = infowindow; - //} + + // Apenas para debug, mostra Lat/Lng no console + displayCoordinates: function(pnt) { + var lat = pnt.lat(); + lat = lat.toFixed(4); + var lng = pnt.lng(); + lng = lng.toFixed(4); + Dashboards.log("Lat: " + lat + " Lng: " + lng); }, - resetButton: function (id, zoom, centerLongitude, centerLatitude) { + showInfo: function(event, mapEngine, infowindow) { + mapEngine.opened_info.close(); + //if (mapEngine.opened_info.name != infowindow.name) { + infowindow.setPosition(event.latLng); + infowindow.open(mapEngine.map); + mapEngine.opened_info = infowindow; + //} + }, + + resetButton: function(id, zoom, centerLongitude, centerLatitude) { - var myself = this; + var myself = this; - var controlReset = document.createElement('div'); - var linkReset = document.createElement('a'); - controlReset.appendChild(linkReset); - controlReset.setAttribute('id', 'controlReset_' + id); - linkReset.setAttribute('id', 'linkReset_' + id); - linkReset.href = "javascript:void(0)"; - linkReset.className = 'gmapsoverlay-button'; - linkReset.onclick = (function () { myself.map.setZoom(zoom); - myself.map.setCenter(new google.maps.LatLng(centerLatitude, centerLongitude)); - }); - linkReset.innerHTML = 'Reset'; + var controlReset = document.createElement('div'); + var linkReset = document.createElement('a'); + controlReset.appendChild(linkReset); + controlReset.setAttribute('id', 'controlReset_' + id); + linkReset.setAttribute('id', 'linkReset_' + id); + linkReset.href = "javascript:void(0)"; + linkReset.className = 'gmapsoverlay-button'; + linkReset.onclick = (function() { + myself.map.setZoom(zoom); + myself.map.setCenter(new google.maps.LatLng(centerLatitude, centerLongitude)); + }); + linkReset.innerHTML = 'Reset'; - myself.map.controls[google.maps.ControlPosition.TOP_LEFT].push(controlReset); + myself.map.controls[google.maps.ControlPosition.TOP_LEFT].push(controlReset); }, - searchBox: function (id) { - - var myself = this; - - var control = document.createElement('div'); - var input = document.createElement('input'); - control.appendChild(input); - control.setAttribute('id', 'locationField_' + id); - input.style.width = '250px'; - input.style.height = '100%'; - input.style.margin = '0px'; - input.style.border = '1px solid #A9BBDF'; - input.style.borderRadius = '2px'; - input.setAttribute('id', 'locationInput_' + id); - myself.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(control); - - var ac = new google.maps.places.Autocomplete(input, { types: ['geocode'] }); - google.maps.event.addListener(ac, 'place_changed', function() { - var place = ac.getPlace(); - if (place.geometry.viewport) { - myself.map.fitBounds(place.geometry.viewport); - } else { - myself.map.setCenter(place.geometry.location); - myself.map.setZoom(17); - } - }); - - google.maps.event.addListener(myself.map, 'bounds_changed', function() { - input.blur(); - input.value = ''; - }); - - input.onkeyup = submitGeocode(input); + exportCSVButton: function(obj) { + + var myself = this; + var id = obj.ph[0].id; + + var controlDiv = document.createElement('div'); + controlDiv.className = 'pull-left'; + var button = document.createElement('button'); + controlDiv.appendChild(button); + controlDiv.setAttribute('id', 'exportCSV_' +id); + button.setAttribute('id', 'CSVButton_' + id); + button.setAttribute('data-placement', 'bottom'); + button.style.opacity ='0.6'; + // button.href = "javascript:void(0)"; + button.title='Export to file csv.'; + button.className = 'btn btn-default btn-xs'; + + button.onmouseover = (function(){ + button.style.opacity ='1'; + $(this).tooltip(); + + }); + button.onmouseout = (function(){ + button.style.opacity ='0.6'; + + }); + button.onclick = (function() { + obj.downloadCSV(); + }); + button.innerHTML = 'CSV'; + + myself.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv); }, - - renderLegend: function (id, mapDefinition, queryResult, colormap, ticks, legendRanges, isContinuousMapColor, isColorDefinedInDS) { - /* - var engNotation = function(d) { - var Log1000 = Math.log(1000); - var engLabels = ['', ' k' , ' M', ' G' , ' T', ' P']; - var exponent3 = ( d == 0 ? 0 : - Math.floor(Math.round( 100 * Math.log(d)/Log1000 )/100) ); - var mantissa = Math.round( 100* d / Math.pow(1000, exponent3))/100; - return mantissa + engLabels[exponent3]; - }; - */ - - if (isContinuousMapColor) - { - var sigFigs = function (num, sig) { - if (num == 0) - return 0; - if (Math.round(num) == num) - return num; - var digits = Math.round((-Math.log(Math.abs(num)) / Math.LN10) + (sig || 2)); - //round to significant digits (sig) - if (digits < 0) - digits = 0; - return num.toFixed(digits); - }; - - - if (queryResult && mapDefinition ) { - var values = _.map(queryResult, function (q) { return q.value; }); - var minValue = _.min(values), - maxValue = _.max(values); - var n = colormap.length; - var rounding=1; - if (maxValue < -5){ - rounding = ((maxValue -minValue)/5).toString().split('.'); - rounding = rounding.length > 1 ? Math.pow(10, Math.max(rounding[1].length, 3)): 1; - } - var legend = _.map(ticks, function (level) { - var value = (minValue + level * (maxValue - minValue)*rounding)/rounding; - return { - value: sigFigs(value,1), - level: level, - fillColor: colormap[Math.floor( level* n -1)] - }; - }); - } - - this.legend = legend; - } - - // Set CSS styles for the DIV containing the control - // Setting padding to 5 px will offset the control - // from the edge of the map - var controlDiv = document.createElement('DIV'); - controlDiv.style.padding = '5px'; - controlDiv.setAttribute('id', 'legendDiv_' + id); - - // Set CSS for the control border - var controlUI = document.createElement('DIV'); - controlUI.setAttribute('id', 'legendUI_' + id); - //controlUI.style.backgroundColor = 'white'; - //controlUI.style.borderStyle = 'solid'; - //controlUI.style.borderWidth = '1px'; - controlUI.title = 'Legend'; - controlDiv.appendChild(controlUI); - - // Set CSS for the control text - var controlText = document.createElement('DIV'); - controlText.setAttribute('id', 'legendText_' + id); - controlText.style.fontFamily = 'Arial,sans-serif'; - controlText.style.fontSize = '12px'; - controlText.style.paddingLeft = '4px'; - controlText.style.paddingRight = '4px'; - - if (isContinuousMapColor) - { - var legendTable = ''; - _.each(legend, function(el){ - var left = (el.level != 0) ? el.level*100 + '%' : '-1px'; - legendTable += "
"+ el.value + "
"; - }); - - // Add the text - controlText.innerHTML = "" + - "
" + - "
" + legendRanges.text + "
" + - "
" + - "
" + - legendTable + - "
" + - "
" + - "
" + legendRanges.source + "
" + - "
"; - - } - else - { - var legendTable = ""; - var qtd = Object.keys(legendRanges.ranges).length; - for (var j = 0; j < qtd; j++) { - - if (isColorDefinedInDS) - { - legendTable += "
  • " + legendRanges.ranges[j].desc + "
  • "; - } - else if (isNaN(legendRanges.ranges[j].min)) - { - legendTable += "
  • <= " + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; - } - else if (isNaN(legendRanges.ranges[j].max)) - { - legendTable += "
  • >= " + legendRanges.ranges[j].min + "" + legendRanges.ranges[j].desc + "
  • "; - } - else - { - //legendTable += "
  • " + legendRanges.ranges[j].min + "-" + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; - legendTable += "
  • " + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; - } - } - - // Add the text - controlText.innerHTML = "" + - "
    " + - "
    " + legendRanges.text + "
    " + - "
    " + - "
      " + - legendTable + - "
    " + - "
    " + - "
    " + legendRanges.source + "
    " + - "
    "; - - } - - controlUI.appendChild(controlText); - this.map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(controlDiv); - + + searchBox: function(id) { + + var myself = this; + + var control = document.createElement('div'); + var input = document.createElement('input'); + control.appendChild(input); + control.setAttribute('id', 'locationField_' + id); + input.style.width = '250px'; + input.style.height = '100%'; + input.style.margin = '0px'; + input.style.border = '1px solid #A9BBDF'; + input.style.borderRadius = '2px'; + input.setAttribute('id', 'locationInput_' + id); + myself.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(control); + + var ac = new google.maps.places.Autocomplete(input, { + types: ['geocode'] + }); + google.maps.event.addListener(ac, 'place_changed', function() { + var place = ac.getPlace(); + if (place.geometry.viewport) { + myself.map.fitBounds(place.geometry.viewport); + } else { + myself.map.setCenter(place.geometry.location); + myself.map.setZoom(17); + } + }); + + google.maps.event.addListener(myself.map, 'bounds_changed', function() { + input.blur(); + input.value = ''; + }); + + input.onkeyup = submitGeocode(input); + }, + + + + renderLegend: function(id, mapDefinition, queryResult, colormap, ticks, legendRanges, myself,obj) { + + + if (myself.isContinuousMapColor) { + var sigFigs = function(num, sig) { + if (num == 0) + return 0; + if (Math.round(num) == num) + return num; + var digits = Math.round((-Math.log(Math.abs(num)) / Math.LN10) + (sig || 2)); + //round to significant digits (sig) + if (digits < 0) + digits = 0; + return num.toFixed(digits); + }; + + + if (queryResult && mapDefinition) { + var values = _.map(queryResult, function(q) { + return q.value; + }); + var minValue = _.min(values), + maxValue = _.max(values); + var n = colormap.length; + var rounding = 1; + if (maxValue < -5) { + rounding = ((maxValue - minValue) / 5).toString().split('.'); + rounding = rounding.length > 1 ? Math.pow(10, Math.max(rounding[1].length, 3)) : 1; + } + var legend = _.map(ticks, function(level) { + var value = (minValue + level * (maxValue - minValue) * rounding) / rounding; + return { + value: sigFigs(value, 1), + level: level, + fillColor: colormap[Math.floor(level * n - 1)] + }; + }); + } + + this.legend = legend; + } + + // Set CSS styles for the DIV containing the control + // Setting padding to 5 px will offset the control + // from the edge of the map + var controlDiv = document.createElement('DIV'); + controlDiv.style.padding = '5px'; + controlDiv.style.width = 'auto'; + controlDiv.setAttribute('id', 'legendDiv_' + id); + + // Set CSS for the control border + var controlUI = document.createElement('DIV'); + controlUI.setAttribute('id', 'legendUI_' + id); + //controlUI.style.backgroundColor = 'white'; + //controlUI.style.borderStyle = 'solid'; + //controlUI.style.borderWidth = '1px'; + //controlUI.title = 'Legend'; + controlDiv.appendChild(controlUI); + + // Set CSS for the control text + var controlText = document.createElement('DIV'); + controlText.setAttribute('id', 'legendText_' + id); + controlText.style.fontFamily = 'Arial,sans-serif'; + controlText.style.fontSize = '12px'; + controlText.style.paddingLeft = '4px'; + controlText.style.paddingRight = '4px'; + // cria constante + var LEGEND_POSITION = {'BOTTOM_CENTER':11, + 'BOTTOM_LEFT':10, + 'RIGHT_BOTTOM':9}; + + if (myself.isContinuousMapColor) { + var legendTable = ''; + _.each(legend, function(el) { + var left = (el.level != 0) ? el.level * 100 + '%' : '-1px'; + legendTable += "
    " + el.value + "
    "; + }); + + // Add the text + controlText.innerHTML = "" + + "
    " + + "
    " + legendRanges.text + "
    " + + "
    " + + "
    " + + legendTable + + "
    " + + "
    " + + "
    " + legendRanges.source + "
    " + + "
    "; + + } else { + var legendTable = ""; + if(!myself.isColorDefinedInDS){ + var qtd = Object.keys(legendRanges.ranges).length; + + + for (var j = 0; j < qtd; j++) { + + if (myself.isColorDefinedInDS) { + legendTable += "
  • " + legendRanges.ranges[j].desc + "
  • "; + } else if (isNaN(legendRanges.ranges[j].min)) { + legendTable += "
  • <= " + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; + } else if (isNaN(legendRanges.ranges[j].max)) { + legendTable += "
  • >= " + legendRanges.ranges[j].min + "" + legendRanges.ranges[j].desc + "
  • "; + } else { + //legendTable += "
  • " + legendRanges.ranges[j].min + "-" + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; + legendTable += "
  • " + legendRanges.ranges[j].max + "" + legendRanges.ranges[j].desc + "
  • "; + } + } + + } + + + + + if(myself.isColorDefinedInDS || typeof obj.mapColorConditional == 'function'){ + + + + var listColorOrdened = []; + var colorIgualDs = false; + var listCloneObj = []; + var contem = function(arry,obj) { + var i = arry.length; + while (i--) { + if (arry[i] === obj) { + return true; + } + } + return false; + }; + // faz a ordenção por cores + listUniqColor = _.sortBy(listUniqColor,'color'); + //obj.legendLabelDescOrderColor = obj.legendLabelDescOrderColor.reverse(); + // Sobrescreve a ordenação das colres na legenda pelo retorna da ordenação condicional + if(typeof obj.legendLabelDescOrderColorConditional == 'function'){ + obj.legendLabelDescOrderColor = obj.legendLabelDescOrderColorConditional(); + } + + if(obj.legendLabelDescOrderColor.length > 0){ + qtdLegend = obj.legendLabelDescOrderColor.length; + for(var i = 0; i < qtdLegend;i++){ + listColorOrdened[i] = {'countColor':(function(j){ + return function(){ + var qtdeTemp = listUniqColor.length; + for(var i = 0; i < qtdeTemp;i++){ + if(!contem(obj.legendLabelDescOrderColor,listUniqColor[i].color)){ + listCloneObj.push(listUniqColor[i]); + // remove istem + listUniqColor.splice(i,1); + i--; + qtdeTemp-- + } + + } + for(var item in listUniqColor){ + colorIgualDs = false; + var valorRetorno = 0; + + + if(listUniqColor[item].color == obj.legendLabelDescOrderColor[j]){ + colorIgualDs = true; + valorRetorno= listUniqColor[item].countColor; + // remove istem + listUniqColor.splice(item,1); + } + + if(colorIgualDs){ + return valorRetorno; + } + + } + if(!colorIgualDs){ + return 0; + } + }() + }(i)) + , 'color':obj.legendLabelDescOrderColor[i]}; + + listUniqColor.push(listColorOrdened[i]); + } + if(listCloneObj.length > 0){ + for(var j in listCloneObj){ + listUniqColor.push(listCloneObj[j]); + } + } + }else{ + qtdLegend = Object.keys(listUniqColor).length; + } + + var fontColor ; + var legendLabelDescInfo; + var legendCountHtml = ''; + var legendLabelConditional = false; + + // retorna um array com as labels condicionais + if(typeof obj.legendLabelDescConditional == 'function'){ + legendLabelDescInfo = obj.legendLabelDescConditional() ; + legendLabelConditional = true; + } + for (var j = 0; j < listUniqColor.length; j++) { + fontColor = obj.legendLabelDescFonteColor[j] != undefined ? obj.legendLabelDescFonteColor[j] : 'black'; + if(typeof obj.legendLabelDescConditional != 'function'){ + legendLabelDescInfo = obj.legendLabelDesc[j] != undefined ? obj.legendLabelDesc[j] : ''; + } + + obj.legendCountVisible ? legendCountHtml = ""+ listUniqColor[j].countColor +"" : legendCountHtml ; + legendTable += ""+ + "
  • " +(legendLabelConditional ? legendLabelDescInfo[j] : legendLabelDescInfo)+ legendCountHtml+"
  • "; + } + // Add the text + controlText.innerHTML = + + "
    " + + (obj.legendTitle != undefined ? "
    " + obj.legendTitle +"
    " : "") + + "
    " + + "
    " + legendRanges.text + "
    " + + ""+ + + "
    " + + "" + + "
    "; + + }else{ + + // Add the text + controlText.innerHTML = "" + + "
    " + + "
    " + legendRanges.text + "
    " + + "
    " + + "
      " + + + legendTable + + + "
    " + + "
    " + + "
    " + legendRanges.source + "
    " + + "
    "; + + } + + + } + + controlUI.appendChild(controlText); + this.map.controls[( LEGEND_POSITION[obj.legendPosition] != undefined ? LEGEND_POSITION[obj.legendPosition] :google.maps.ControlPosition.BOTTOM_CENTER)].push(controlDiv); }, showPopup: function(data, mapElement, popupHeight, popupWidth, contents, popupContentDiv, borderColor) { var overlay = new OurMapOverlay(mapElement.getPosition(), popupWidth, popupHeight, contents, popupContentDiv, this.map, borderColor); - $(this.overlays).each(function (i, elt) {elt.setMap(null);}); + $(this.overlays).each(function(i, elt) { + elt.setMap(null); + }); this.overlays.push(overlay); } diff --git a/gmapsoverlay.css b/gmapsoverlay.css index 312d1fb..ca38eb0 100644 --- a/gmapsoverlay.css +++ b/gmapsoverlay.css @@ -1,4 +1,3 @@ - /* @media print { */ /* html, body { */ /* height: auto; */ @@ -172,4 +171,111 @@ ul.gmapsoverlay-legend-labels-range li span { a.gmapsoverlay-button { color: #FFFFFF; -} \ No newline at end of file +} + +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + margin: 3px 7px; + font-size: 12px; + font-weight: 700; + line-height: 1; + color: #000; + text-align: center; + white-space: nowrap; + vertical-align: middle; + background-color: #fff; + border-radius: 10px; + +} + + + + +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} + +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + +} + + + + +.col-md-1 { + width: 8.33333333%; + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} + +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + + .col-md-1 { + width: 8.33333333%; + } + + .col-md-pull-1 { + right: 8.33333333%; + } + + .col-md-push-1 { + left: 8.33333333%; + } + + .col-md-offset-1 { + margin-left: 8.33333333%; + } + +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; + +} + +.nav > li { + position: relative; + display: block; +} + +.nav:before, +.nav:after, +.panel-body:before, +.panel-body:after + { + display: table; + content: " "; +} + + + From 23c5ef493ea5ccbfad563502072fe7910e522bda Mon Sep 17 00:00:00 2001 From: Josemar Date: Thu, 29 Jun 2017 15:23:27 -0300 Subject: [PATCH 02/15] add label --- component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component.xml b/component.xml index abc9224..7cfddf2 100644 --- a/component.xml +++ b/component.xml @@ -3,7 +3,7 @@
    Google Maps Overlay Component gMapsOverlayComponent - Google Maps Overlay Component (By Kleyson Rios) + Google Maps Overlay Component (By Kleyson Rios / Josemar Rincon) COMMUNITYCOMPONENTS Community Contributions PalleteEntry From 142473c3fc5d36078fea433da1835dbb3d89f3d4 Mon Sep 17 00:00:00 2001 From: Josemar Date: Thu, 29 Jun 2017 17:14:12 -0300 Subject: [PATCH 03/15] =?UTF-8?q?add=20descri=C3=A7=C3=A3o=20das=20funcion?= =?UTF-8?q?alidades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/README.md b/README.md index 63742dc..e5cf21a 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,104 @@ See the video for GMapsOverlay Version 1.0.0

    Adding New Maps

    For new maps just create a new definition map and save it in the pentaho-solutions/cde/components/gmapsoverlay/map-def folder. + +

    Novas funcionalidades do plugin

    + +- **DoubleClickAction** + - Voce pode especificar uma função com dois parâmetros + serve para voce executar outra ação baseando se no valor do shape que recebeu duplo click + + function(obj,e){ + if(regiao_mapa !== '[Municipio].[MunicipioX]'){ + Dashboards.fireChange('regiao_selecionada_mapa', obj.infowindow.dataPayload.name); + } + } + +- **DisableDoubleClickZoom**: true | false + opção de desativar o zoom no double click pois ela interfere se voce for usar a função DoubleClickAction + +- **LabelsIcons**: On | Off + Mostra icones no mapa + +- **AdministrativeLocality**: On | Off + Mostra informaçoes de locatidades + +- **MapColorConditional** + Voce pode definir um função que recebe um parametro e baseado no valor desse retorna uma cor no formato #000000.
    + Obs: para utilizar esta função a opção isColorDefinedInDS tem que estar false. + + function(value){ + if(value > 20){ + return '#00FF00' + } + } + +- **MapNameConditional** + Aqui voce define uma função que retorna o nome do arquivo shape file que será desenhado no mapa dependendo de uma determinada condição + + + function(){ + + if (regiao_mapa == '[MunicipioResidencia].[MunicipioX]') { + return 'goias-municipios'; + } else if (regiao_mapa == '[RegiaoSaude].[RegiaoSaudeX]') { + return 'goias-regiao-saude'; + } else if (regiao_mapa == '[MacroRegiao].[MacroRegiaoX]') { + return 'goias-macro'; + } else if (regiao_mapa == '[RideRegiao].[RIDEX]') { + return 'goias-ride'; + + } + } + +- **ScrollWhell** + Habilita ou desabilita o zoom no scroll +- **ShapeFillOpacity** + Defini a transparencia do shape +- **shapeStrokeWeight** + Defini a espessura das linhas do shape +- **ValueFormat** + Aqui voce defini uma função que recebe um parametro de valor onde voce vai formatar o valor e retornar o valor formatado. + + function(value){ + return accounting.toFixed(value, 2)+"%"; + + } + +- **ZoomControl** + Habilita/deshabilita controle de zoom +- **isColorDefinedInDS**: true | false + Se essa opção for **true** é obrigatório trazer a cor(no formato: #00FF00) na terceira coluna do seu datasource +- **LegendItemLabelDescConditional** + Aqui voce defini uma função que retorna um array com a descrição do item da legenda + + function (){ + if ( MENU_SELECIONADO == PRE_NATAL) { + return ['≥75.01%','≥ 50.01% e ≤75%','≤ 50%','0%']; + }else if(MENU_SELECIONADO == MAES_ADOLESCENTES){ + return ['≥0.01% e ≤15%','≥ 15.01% e ≤25%','≥ 25.01%','0%']; + } + } + + - **LegendItemLabelDescFonteColor** +  Cor da descrição do item na legenda aqui voce escrever a cor ex: 'white' + - **LegendItemLabelDescFonteSize** + Tamanha do fonte do item da legenda + - **LegendOpacity** +  Transparência da legenda + - **LegendPosition** +  Posição da legenda + - **LegendItemCountVisible** + Mostra um contador das cores da legenda que estao no shape + - **ExportToCSVFileVisible** +  Habilita/desabilita opção na legenda de exportar os dados do mapa para csv + + #### Exemplos: #### + + - **Mapa por municipios** + ![MAPA_MUN](http://fs5.directupload.net/images/170629/krq5ktby.png ) + + - **Mapa por Região** +![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170629/kxk299k7.png ) + + From d87df44d977fd4568d00e7d5db88b243fc73c655 Mon Sep 17 00:00:00 2001 From: Josemar Date: Thu, 29 Jun 2017 17:35:59 -0300 Subject: [PATCH 04/15] link imagens --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5cf21a..8bd1600 100644 --- a/README.md +++ b/README.md @@ -115,10 +115,11 @@ For new maps just create a new definition map and save it in the pentaho-solutio #### Exemplos: #### - - **Mapa por municipios** - ![MAPA_MUN](http://fs5.directupload.net/images/170629/krq5ktby.png ) +- **Mapa por municipios** + - - **Mapa por Região** -![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170629/kxk299k7.png ) +- **Mapa por Região** + + ![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170629/gzhinikv.png ) From 3a56ad8aad52379c4d0ee670b34ba76e850eb627 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 19:40:02 -0300 Subject: [PATCH 05/15] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bd1600..bc2268b 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,9 @@ For new maps just create a new definition map and save it in the pentaho-solutio #### Exemplos: #### - **Mapa por municipios** - + + ![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170630/pe68hhbi.png ) + - **Mapa por Região** From cdd1987b2bb2702313431fa03566b55cae62b545 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 19:46:35 -0300 Subject: [PATCH 06/15] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bc2268b..802bccc 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ GMaps Version 1.x tested on Pentaho 4.5 / 4.8

    Sample

    -https://sourceforge.net/projects/pentahogmapsoverlay/files/ + https://sourceforge.net/projects/pentahogmapsoverlay/files/

    Usage

    See the video for GMapsOverlay Version 1.0.0
    -http://youtu.be/oyppms5fGhc + + http://youtu.be/oyppms5fGhc

    Adding New Maps

    @@ -117,7 +118,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio - **Mapa por municipios** - ![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170630/pe68hhbi.png ) + ![MAPA_MUNICIPIOS]( http://fs5.directupload.net/images/170630/9bfwicpi.png ) - **Mapa por Região** From 083f8da0806819e343b55a3050be1a669d4b9881 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 19:51:38 -0300 Subject: [PATCH 07/15] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 802bccc..7ebf935 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,13 @@ For new maps just create a new definition map and save it in the pentaho-solutio  Habilita/desabilita opção na legenda de exportar os dados do mapa para csv #### Exemplos: #### + +- **Dashboards feitos que utilizam esse plugin ** + https://extranet.saude.go.gov.br/public/genesis.html + https://extranet.saude.go.gov.br/public/sim.html + https://extranet.saude.go.gov.br/public/dengue.html + - **Mapa por municipios** ![MAPA_MUNICIPIOS]( http://fs5.directupload.net/images/170630/9bfwicpi.png ) From 15cb58422e044b7a2083a85a050aa631b57cdd64 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 19:55:36 -0300 Subject: [PATCH 08/15] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ebf935..e7e1e1d 100644 --- a/README.md +++ b/README.md @@ -118,9 +118,9 @@ For new maps just create a new definition map and save it in the pentaho-solutio - **Dashboards feitos que utilizam esse plugin ** - https://extranet.saude.go.gov.br/public/genesis.html - https://extranet.saude.go.gov.br/public/sim.html - https://extranet.saude.go.gov.br/public/dengue.html + [Dashbord SINASC](https://extranet.saude.go.gov.br/public/genesis.html) + [Dashbord SIM](https://extranet.saude.go.gov.br/public/sim.html) + [Dashbord DENGUE](https://extranet.saude.go.gov.br/public/dengue.html) - **Mapa por municipios** From a22d60c501164c04a0ed092a6164734672ba8656 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:02:04 -0300 Subject: [PATCH 09/15] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e7e1e1d..b463a22 100644 --- a/README.md +++ b/README.md @@ -116,11 +116,11 @@ For new maps just create a new definition map and save it in the pentaho-solutio #### Exemplos: #### -- **Dashboards feitos que utilizam esse plugin ** +- **Dashboards que utilizam esse plugin** - [Dashbord SINASC](https://extranet.saude.go.gov.br/public/genesis.html) - [Dashbord SIM](https://extranet.saude.go.gov.br/public/sim.html) - [Dashbord DENGUE](https://extranet.saude.go.gov.br/public/dengue.html) + - [Dashbord SINASC](https://extranet.saude.go.gov.br/public/genesis.html "Dashbord SINASC") + - [Dashbord SIM](https://extranet.saude.go.gov.br/public/sim.html "Dashbord SIM") + - [Dashbord DENGUE](https://extranet.saude.go.gov.br/public/dengue.html "Dashbord DENGUE") - **Mapa por municipios** From c8adb46a6887e603d80249d1f8011a78d29ca1f7 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:28:57 -0300 Subject: [PATCH 10/15] Update README.md --- README.md | 55 +++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index b463a22..17cdbac 100644 --- a/README.md +++ b/README.md @@ -11,24 +11,23 @@ GMaps Version 1.x tested on Pentaho 4.5 / 4.8

    Sample

    - https://sourceforge.net/projects/pentahogmapsoverlay/files/ +[How to use this plugin](https://sourceforge.net/projects/pentahogmapsoverlay/files/ "How to use this plugin")

    Usage

    See the video for GMapsOverlay Version 1.0.0
    - http://youtu.be/oyppms5fGhc + [video](http://youtu.be/oyppms5fGhc "Plugin video usage")

    Adding New Maps

    For new maps just create a new definition map and save it in the pentaho-solutions/cde/components/gmapsoverlay/map-def folder. -

    Novas funcionalidades do plugin

    +

    New plugin features

    - **DoubleClickAction** - - Voce pode especificar uma função com dois parâmetros - serve para voce executar outra ação baseando se no valor do shape que recebeu duplo click - + - You can specify a function with two parameters for you to call another action based on the value of the shape that received double click + function(obj,e){ if(regiao_mapa !== '[Municipio].[MunicipioX]'){ Dashboards.fireChange('regiao_selecionada_mapa', obj.infowindow.dataPayload.name); @@ -36,17 +35,17 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **DisableDoubleClickZoom**: true | false - opção de desativar o zoom no double click pois ela interfere se voce for usar a função DoubleClickAction + Option to deactivate the zoom in the double click because it interferes if you will use the DoubleClickAction - **LabelsIcons**: On | Off - Mostra icones no mapa + Show icons on the map - **AdministrativeLocality**: On | Off - Mostra informaçoes de locatidades + Show location information - **MapColorConditional** - Voce pode definir um função que recebe um parametro e baseado no valor desse retorna uma cor no formato #000000.
    - Obs: para utilizar esta função a opção isColorDefinedInDS tem que estar false. + You can define a function that receives a parameter and based on the value of it returns a color in the format #000000.
    + Obs: The isColorDefinedInDS property must be false for use of this function. function(value){ if(value > 20){ @@ -55,7 +54,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **MapNameConditional** - Aqui voce define uma função que retorna o nome do arquivo shape file que será desenhado no mapa dependendo de uma determinada condição + Here you define a function that returns the file name of the shape that will be drawn on the map depending on a certain condition function(){ @@ -73,13 +72,13 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **ScrollWhell** - Habilita ou desabilita o zoom no scroll + Enables or disables scroll zoom - **ShapeFillOpacity** - Defini a transparencia do shape + Here you define the transparency of shape - **shapeStrokeWeight** - Defini a espessura das linhas do shape + Define a shape line thickness - **ValueFormat** - Aqui voce defini uma função que recebe um parametro de valor onde voce vai formatar o valor e retornar o valor formatado. + Here you define a function that receives a value parameter where you will format the value and return the formatted value. function(value){ return accounting.toFixed(value, 2)+"%"; @@ -87,11 +86,11 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **ZoomControl** - Habilita/deshabilita controle de zoom + Enable / disable zoom control - **isColorDefinedInDS**: true | false - Se essa opção for **true** é obrigatório trazer a cor(no formato: #00FF00) na terceira coluna do seu datasource + If this option is ** true ** it is mandatory to bring the color (in the format: # 00FF00) in the third column of your datasource - **LegendItemLabelDescConditional** - Aqui voce defini uma função que retorna um array com a descrição do item da legenda + Here you define a function that returns an array with the description of the legend item function (){ if ( MENU_SELECIONADO == PRE_NATAL) { @@ -102,32 +101,32 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **LegendItemLabelDescFonteColor** -  Cor da descrição do item na legenda aqui voce escrever a cor ex: 'white' +  Color description of the item in the legend. Here you write the color ex: 'white' - **LegendItemLabelDescFonteSize** - Tamanha do fonte do item da legenda + Legend item font size - **LegendOpacity** -  Transparência da legenda +  Legend Transparency - **LegendPosition** -  Posição da legenda +  Position Legend - **LegendItemCountVisible** - Mostra um contador das cores da legenda que estao no shape + Show a counter of the legend colors that are in shape - **ExportToCSVFileVisible** -  Habilita/desabilita opção na legenda de exportar os dados do mapa para csv +  Enable / disable option in subtitle to export map data to csv #### Exemplos: #### -- **Dashboards que utilizam esse plugin** +- **Dashboards that use this plugin** - [Dashbord SINASC](https://extranet.saude.go.gov.br/public/genesis.html "Dashbord SINASC") - [Dashbord SIM](https://extranet.saude.go.gov.br/public/sim.html "Dashbord SIM") - [Dashbord DENGUE](https://extranet.saude.go.gov.br/public/dengue.html "Dashbord DENGUE") -- **Mapa por municipios** +- **Map by towns** ![MAPA_MUNICIPIOS]( http://fs5.directupload.net/images/170630/9bfwicpi.png ) -- **Mapa por Região** +- **Map by Health Region** ![MAPA_REGIAO SAUDE]( http://fs5.directupload.net/images/170629/gzhinikv.png ) From aa9aa4a421c653c8043cc6c070b6b921c031b1ec Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:29:30 -0300 Subject: [PATCH 11/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17cdbac..15ee648 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ GMaps Version 1.x tested on Pentaho 4.5 / 4.8
    See the video for GMapsOverlay Version 1.0.0
    - [video](http://youtu.be/oyppms5fGhc "Plugin video usage") + [Plugin video usage](http://youtu.be/oyppms5fGhc "Plugin video usage")

    Adding New Maps

    From f75e62a00c6cd79d6252837d5b8164b714e1e0f2 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:33:37 -0300 Subject: [PATCH 12/15] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15ee648..199fd0b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio } - **DisableDoubleClickZoom**: true | false - Option to deactivate the zoom in the double click because it interferes if you will use the DoubleClickAction + Option to disable the zoom in the double click because it interferes if you will use the DoubleClickAction - **LabelsIcons**: On | Off Show icons on the map @@ -44,7 +44,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio Show location information - **MapColorConditional** - You can define a function that receives a parameter and based on the value of it returns a color in the format #000000.
    + You can define a function that receives a parameter and based on the value of this parameter returns a color in the format #000000.
    Obs: The isColorDefinedInDS property must be false for use of this function. function(value){ From dc027601f493348f9c7ca958a5a7fcdc098d2113 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:40:25 -0300 Subject: [PATCH 13/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 199fd0b..127dfe1 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio - [Dashbord SIM](https://extranet.saude.go.gov.br/public/sim.html "Dashbord SIM") - [Dashbord DENGUE](https://extranet.saude.go.gov.br/public/dengue.html "Dashbord DENGUE") -- **Map by towns** +- **Map by municipality** ![MAPA_MUNICIPIOS]( http://fs5.directupload.net/images/170630/9bfwicpi.png ) From 63c3fc236d6b2f9fe9e2dfb63d8f283ca1ced8f9 Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:44:22 -0300 Subject: [PATCH 14/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 127dfe1..281c382 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio - **ExportToCSVFileVisible**  Enable / disable option in subtitle to export map data to csv - #### Exemplos: #### + #### Cases: #### - **Dashboards that use this plugin** From 0ecf5750b85652826222295dfb89007b814df7eb Mon Sep 17 00:00:00 2001 From: Josemar Pereira Rincon Date: Thu, 29 Jun 2017 20:47:08 -0300 Subject: [PATCH 15/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 281c382..6ce742b 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ For new maps just create a new definition map and save it in the pentaho-solutio - **ExportToCSVFileVisible**  Enable / disable option in subtitle to export map data to csv - #### Cases: #### + #### Sample: #### - **Dashboards that use this plugin**