1

I have a single feature in a cartodb which I am pulling into my HTML page using var layerUrl = 'path-to-/viz.json';

cartodb.createLayer(map, layerUrl) .addTo(map)

And I can see the layer on some zoom scales but others it vanishes.

It can't be a conflict with another geometry as there are no others in the table.

Any ideas?

EDIT

The path to a test viz is here: https://osnhs.cartodb.com/api/v2/viz/39628358-3206-11e5-8ec0-0e4fddd5de28/viz.json

My HTML page enables a user to draw a polygon using the Leaflet draw polygon tool and this is then saved to a table.

This table is then used for the viz.json

It seems the polygon does not show at the zoom level that the polygon is drawn at. If I zoom one level out or in the polygon appears.

Unfortunately, I cannot share the complete HTML but I used the following example http://bl.ocks.org/matallo/130b969a6cc76939985d

  • We would need to see the data or the viz.json to be able to debug something from here :-) – iriberri Jul 24 '15 at 16:21
  • Thanks, I see it now! The geometries are correct (I was expecting them not to be, you can test this with PostGIS by running ST_IsValid(the_geom) and I'm not experiencing any issue like the one you describe, so I don't know what could be causing this issue. Perhaps a slow internet connection that is not loading the tiles? By the way, the bl.ocks example you refer to includes the API Key in a client-side file, I hope you're not including yours in any public site because your account could get compromised! – iriberri Jul 27 '15 at 13:08
  • 1
    @iriberri i think its the refresh time. I added refreshTime: 2000 and it seems to really help. Going to implement a security definer - blog.cartodb.com/… – tjmgis Jul 27 '15 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.