javascript - Binding dc.js to Google Maps with crossfilter -
Question: This device could provide toy examples using any DCJS + Google Maps Is where I brush on a dc.js chart, the map marker is updated in accordance with the selected / brush in the chart?
What I have so far: Full repo has given me this good example, but it uses this sheet. I was trying to avoid the sheet if possible.
I am trying to force Google Maps to dc.js (crossfilters). I have seen it and I am capable of optimizing the example.
However, when I try to customize it to use dc.js
, then I can not put the crossfilter back to Google Maps. (I can still tie Maps with CrossFilters / DCJs, not just around). That is, when scrolling on the map, the chart is adjusted, but when I brush the chart, I can not seem to do my updateMarkers ()
function.
function init () {initMap (); InitCrossFilter (); // Litemd = ndx.dimension in the Light / LNG NADX dimensions to map range (function (p) {return p.lott;}); LngDim = ndx.dimension (function (p) {returns p. Lg;}); Google.maps.event.addListener (map, 'bounds_changed', function () {var bounds = this.getBounds (); var Northeast = Obligations.North East (); var Southwest = Obligations.GetWeath (); // Note: Requirements here to be careful with the date lngDim.filterRange ([southWest.lng (), north east.Lin ()]); latDim.filterRange ([southwest.lat (), northest.lat ()]); // note : Maybe you want to request here, animationframe dc.renderAll ();}); To view the selected markers idDim = ndx.dimension (function (p, i) {return i;}) at the current time, // dimension and group; IdGroup = idDim.group (function (id) {return id;}); RenderAll (); } Function Update Markers () {var pointIds = idGroup.all (); (Var i = 0; i & lt; pointIds.length; i ++) for {var point id = pointIds [i]; Marker [pointId.key] .setVisible (pointId.value> 0); }} Function render all () {updateMarkers (); Dc.renderAll (); } It seems that you are missing from callback back from dc.js in Google Maps. In the original example, they were using
domCharts = d3.selectAll ("chart"). Data (chart) .each (function (chart) (chart.on ("brush", RenderAll) .on ("brushend", renderAll);});
Which dc.js. Can work with or not.
Although there are other ways to do this, the most idiomatic method of connecting a non-dc.js chart with the dc.js chart is to register it in the chart registry.
Unfortunately, this is inappropriate, but to learn how to register your Google Maps to hear the events presented from other charts, with useful comments from them, on this SO answer one Take a look at those brushes:
Comments
Post a Comment