Skip to content

Instantly share code, notes, and snippets.

@jatorre
Created June 13, 2013 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jatorre/5773850 to your computer and use it in GitHub Desktop.
Save jatorre/5773850 to your computer and use it in GitHub Desktop.
LineStyle lineStyle = LineStyle.builder().setWidth(0.05f).setColor(Color.WHITE).build();
PolygonStyle polygonStyle = PolygonStyle.builder().setColor(0xFFFF6600 & 0x80FFFFFF).setLineStyle(lineStyle).build();
StyleSet<PolygonStyle> polygonStyleSet = new StyleSet<PolygonStyle>(polygonStyle);
// note the SQL has special string !bbox! as bounding box dynamic value placeholder
String sql = "SELECT name,iso2,pop2005,area,the_geom_webmercator FROM tm_world_borders WHERE the_geom_webmercator && ST_SetSRID('BOX3D(!bbox!)'::box3d, 3857) LIMIT 3000";
CartoDbVectorLayer cartoLayer = new CartoDbVectorLayer(new EPSG3857(), "nutiteq", sql, null, null, polygonStyleSet);
mapView.getLayers().addLayer(cartoLayer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment