Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style by histogram raises a maps api exception #317

Closed
javisantana opened this issue Apr 27, 2016 · 3 comments
Closed

style by histogram raises a maps api exception #317

javisantana opened this issue Apr 27, 2016 · 3 comments
Assignees

Comments

@javisantana
Copy link
Contributor

javisantana commented Apr 27, 2016

  1. open http://localhost:9002/examples/populated-places.html
  2. style by population

the maps api raises

{"errors":["style0:1:11 Invalid code: places[\"mapnik::geometry_type\"=polygon]{\n"]}

same error is raised when it's styled by any category value

@javisantana
Copy link
Contributor Author

proposed solution:

diff --git a/dist/deep-insights.uncompressed.js b/dist/deep-insights.uncompressed.js
index 9f480b2..ecf03e6 100644
--- a/dist/deep-insights.uncompressed.js
+++ b/dist/deep-insights.uncompressed.js
@@ -97817,7 +97817,7 @@ var AutoStyler = cdb.core.Model.extend({
   },

   _getLayerHeader: function (symbol) {
-    return '#' + this.dataviewModel.layer.get('layer_name') + '[mapnik-geometry-type=' + AutoStyler.MAPNIK_MAPPING[symbol] + ']{';
+    return '#' + this.dataviewModel.layer.get('layer_name').replace(/\s*/g, '') + '[mapnik-geometry-type=' + AutoStyler.MAPNIK_MAPPING[symbol] + ']{';
   }

 });
@@ -97850,9 +97850,9 @@ AutoStyler.STYLE_TEMPLATE = {
 };

 AutoStyler.MAPNIK_MAPPING = {
-  polygon: 'polygon',
-  marker: 'point',
-  line: 'linestring'
+  polygon: 3,
+  marker: 1,
+  line: 2
 };

@javisantana javisantana assigned fdansv and unassigned rochoa Apr 27, 2016
@javisantana
Copy link
Contributor Author

hey @fdansv, this is fixed right?

@fdansv
Copy link
Contributor

fdansv commented May 3, 2016

it should be as of #321

@fdansv fdansv closed this as completed May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants