4

Check out this post I just wrote on selecting a polygon and highlighting it. Once you have the polygon that was clicked on, you simply do a query with intersection. Clicking on feature to create particular new map using ArcGIS API for JavaScript? You could substitute below into the mapOnClick(evt) function above... var queryTask = new esri.tasks.QueryTask(...


4

If you can't process the data beforehand, another method may be to add the layers as separate FeatureLayers in the map, and use the geometry of the selected polygon to query the point layer. When the selection is complete, do a count of the features using FeatureLayer::getSelectedFeatures and use that count to provide information in your popup. Here is a ...


4

The easiest way is to use the mustache templates. In the custom HTML infowindow field (or hovers), you can put the following around text you want to conditionally appear: {{#col_name}} <p>{{col_name}}</p> {{/col_name}} {{^col_name}} <p>No information</p> {{/col_name}}


4

Ok two things here I think. Getting information for a point and creating a shapefile. Information. There is a tool called "Identify Features" which is a point that allows you to bring up a window with the attributes of that feature. It is location in the "View" menu or via the button in the attached image (left button with the 'i'). The only trick is ...


3

You can disconnect the ESRI Zoom To function like this: dojo.disconnect(map.infoWindow._eventConnections[4]); This assume your var map = esri.Map(). The the fifth element in the _eventConnections array is the zoom to event. Then you can attach your own events to the Zoom To with jQuery or dojo: // Add custom zoom To $('.action.zoomTo').click(function () {...


3

There are a couple of solutions to this that both involve creating the layer object yourself - http://docs.cartodb.com/cartodb-platform/cartodb-js/layer-source-object/ The first option is to query a dataset directly and modify the cartocss as needed. You will then need to insert html infowindow template - infoWindow = cdb.vis.Vis.addInfowindow(map, layer, ...


3

If your information is already prepared in the way you're showing and you're just missing the percentage, there's a super straightforward trick for you. You can edit the custom HTML of the infowindows, which means that besides selecting which columns and titles are going to be shown there, you can also play with them a bit. The workaround is easy: you just ...


3

CartoDB disables < script > and < iframe > tags on infowindows due to security reasons. However, you could still disable this, by using the sanitizeTemplate:falseoption when declaring an infowindow, like this: sublayer.infowindow.set({ template: $('#infowindow_template').html(), width: 218, maxHeight: 100, sanitizeTemplate:false }); ...


3

I believe that your issue has to do with a known bug that reorders the position of the interactivity columns in custom infowindows. Perhaps the bug is just affecting one of the layers. I recommend to take a look at my response here: Cartodb image header doesn't show up after publishing the map I took a look at your interactivity data for your layers and ...


3

You have to set the cartodb_id interactivity in your layer_source variable: var layerSource = { user_name: 'examples', type: 'cartodb', sublayers: [{ sql: 'select * from country_boundaries', cartocss: '#layer { polygon-fill: #F00; polygon-opacity: 0.3; line-color: #F00; }', interactivity: ['cartodb_id', 'abbrev'] ...


2

In your case using InfoBox sounds like the best solution.


2

The standard info window will only show above the marker. If you want an info window to be positioned elsewhere, you will have to look at the various custom info windows that others have created, or created your own.


2

One good way to do this would be to cheat: Calculate Statistics for the polygon/point data apriori, adding the relevant field attributes. Use JS identify to simply pop up the relevant field information on click.


2

The API Documentation shows 4 parameters that you can use when creating a graphic ... new Graphic(geometry?, symbol?, attributes?, infoTemplate?) see API Documentation for "Graphic". You just need to set up your info Template and then attach it to the graphic when you make that call. You are currently only using 2 of the 4 parameters. See this sample ...


2

The last line of the getTextContent function in that sample shows how an infoWindow can contain HTML: return "<b>" + commName + "</b><br /><a target='_blank' href=http://en.wikipedia.org/wiki/" + sciName +">Wikipedia Entry</a>"; You can set this using infoWindow.setContent, and point to the location of the video. From this ...


2

Yes, it's possible programmatically. This post does a very good job of explaining it: http://zevross.com/blog/2014/05/05/cartodb-handling-infowindows-for-overlapping-features/


2

As John said, map.infoWindow is an instance of esri/dijit/Popup, not esri/dijit/InfoWindow like it was many releases ago. You can specify anchor directly: map.infoWindow.anchor = "top"; Or use set(): map.infoWindow.set("anchor", "top"); All valid values are listed in the API ref for the popup's anchor property.


2

You can do some tricks by using the custom HTML option for the infowindows and add some custom styles there. For example: <div class="cartodb-popup v2" style="background: grey;"> <a href="#close" class="cartodb-popup-close-button close">x</a> <div class="cartodb-popup-content-wrapper"> <div class="cartodb-popup-content"> <...


2

This is not that simple. You have to edit your info window html. Once inside the html. find the ones you want to check if their null (all of them guess) then add these around the <h4> and <p> tags {{#columnname}} <h4>columnname</h4> <p>{{columnname}}</p> {{/columnname}} but it could break some formatting. the info ...


2

Inspecting the source shows it's definitely a text "x", but it looks like the CartoDB editor has it in a :before pseudo-class that you're not going to be able to style inline. But it looks like you're trying to hide the button (you have the background and font both set to black) so you could just take out that whole a href line. That would have the side ...


2

As long as you leave the close class the close mechanism will work. You can change the defaults styles by removing cartodb-popup-close-button class, but then you would have to define the styles inline yourself to position it too, e.g.: <a href="#close" class="close" style="position:absolute;top: -12px; right: -12px; width: 20px; height: 20px; background: ...


2

Yes, you can do it. Just render the HTML you need in the view and "inject" that code in the visualization infowindow template. For example: ... layer.infowindow.set('template', document.getElementById('infowindow_template')); ...


2

You need to use inline CSS code in the custom HTML option, for example: <p style="color:#FABADA;">{{country_name}}</p> But take into account that fonts that aren't loaded in the system will not work, as adding fonts in the Custom HTML code is not allowed due to the sanitization that the custom code suffers.


2

Here you have an example of sanitization by using createViz: cartodb.createVis('map', 'viz.json', { description: true, search: true, shareable: true }) .on('done', function(vis,layers) { var layer = layers[1].getSubLayer(0); //layer.infowindow.set('template', $('#infowindow_template').html()); layer.infowindow.set('...


2

You can do that with CartoDB.js (instead of the Editor). You can find here how to make a map from the ground up. And here I make an example that you can replicate with your own data. First, you have to create a div within your html template with a id of "box". Inside you have to add the fields you need to display. In my case I chose latitude, longitude, ...


2

I have modified a little bit the structure of your code in order to improve legibility and functionality. As mentioned at the begining of the html, I have used a block from a colleague that has all the elements (infowindows, tooltips, legend, fixed boxes...) added to a createLayer CartoDB.js map. Fist, have a look at the end of the block and observe how I ...


2

You can use CARTO.js method addInfowindow(), as explained here (for more info here). cdb.vis.Vis.addInfowindow(map object to add enable the infowindow, layer to enable infowindow, ['fields to get information']) However, you can create custom infowindows with different tools (Moustache, HTML, underscore). Whatever choice you use, you would need to create ...


2

When you import a dataset into CARTO with latitude and longitude columns, CARTO converts these values into a geometry (and assigning this to the the_geom column). So, if you change again any latitude/longitude values after importing, you should: a. Georeference again your dataset from the Editor's UI. b. Update the_geom column using these new values from ...


1

The simplest way I can think to do it is: Adding another column in your data table that is a link to an external image of the country flags Change the infowindow HTML template so that the flag appears where you want it For example, something like this: <div class="cartodb-popup v2"> <a href="#close" class="cartodb-popup-close-button close">x&...


1

That was a bug that was fixed (documented here). From what I can see in your map, that does not happen anymore.


Only top voted, non community-wiki answers of a minimum length are eligible