CartoDB / tangram-cartocss

⛔️ DEPRECATED Transform cartocss into a draw tangram object
https://cartodb.github.io/tangram-cartocss/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Revove textures code #54

Closed IagoLast closed 7 years ago

IagoLast commented 7 years ago

Since textured markers are buggy in tangram, it makes no sense to have code for that in our library.

Note: This PR needs to be used with a new version of the tangram-reference where marker-files are not allowed.

IagoLast commented 7 years ago

The use case would be:

  1. Remove marker.file from the tangram reference
  2. Use the master branch against that reference
  3. Load a map with markers
  4. An error should be thrown.
  5. With this branch the error disappears.
alonsogarciapablo commented 7 years ago
  1. Load a map with markers

I guess the layer needs to have a marker-file in the CartoCSS, right?

IagoLast commented 7 years ago

Nope, In cartocss is calledurl(..)

alonsogarciapablo commented 7 years ago

It should have something like:

marker-file: url('https://s3.amazonaws.com/com.cartodb.users-assets.production/maki-icons/cafe-18.svg');
IagoLast commented 7 years ago

Right something like this:

#layer {
  marker-width: 20;
  marker-fill: #FFB927;
  marker-fill-opacity: 0.9;
  marker-file: url('https://s3.amazonaws.com/com.cartodb.users-assets.production/maki-icons/marker-18.svg');
  marker-allow-overlap: true;
  marker-line-width: 1;
  marker-line-color: #FFF;
  marker-line-opacity: 1;
}
alonsogarciapablo commented 7 years ago
  1. With this branch the error disappears.

I still see the following error in this branch:

renderer_js.js?5c39:245 Uncaught (in promise) Error: :5:2 Unrecognized rule: marker-file. Did you mean marker-fill?
    at CartoCSS.parse (renderer_js.js?5c39:245)
    at CartoCSS.setStyle (renderer_js.js?5c39:120)
    at CartoCSS (renderer_js.js?5c39:10)
    at carto.RendererJS.render (renderer_js.js?5c39:292)
    at Object.extractFeatures [as carto2Draw] (carto.js?81a1:16)
    at Object.TH.setLayerDraw (tangram-helper.js?a135:23)
    at eval (main.js?a292:52)
    at Array.forEach (<anonymous>)
    at _callee$ (main.js?a292:41)
    at tryCatch (runtime.js?1aab:65)

I guess that's the error that will be captured here, right? I guess it's a legit error since this library doesn't support marker-file...

IagoLast commented 7 years ago

Since the new version of the carto compiler detects the error before reaching the tangram-carto code this I think PR is outdated

alonsogarciapablo commented 7 years ago

Closing this PR then.