Open jameslaneconkling opened 10 years ago
not sure. couple (untested) ideas: 1) maybe another plugin is conflicting - try uninstalling other plugins, or 2) maybe the code in this plugin is not detecting that you are using a custom tilejson url (try adding some print statements to the code like right here to see if that is getting invoked).
I uninstalled all other plugins, but the problem persists.
started digging around in the Map.bones file you suggested. I'm not much of a developer, but familiar enough with js to get much (or some) of what's going on. If I tried to debug where you suggested, what would I use to print messages to the console?
Thanks for the help, of course.
Ah, console.log() seems to work, but only when defined outside of the function assigned to view.prototype.render.
console.log() yes, just realize that depending on where it is you might need to check the tilemill console/logs and/or your browsers debug: http://debugbrowser.com/
Did you get it to work? I got the same error.
not yet. spent some time trying to debug, but couldn't pinpoint.
(in the meantime, I've just uploaded a small version of the map to mapbox).
On Fri, Sep 5, 2014 at 11:31 AM, pakore notifications@github.com wrote:
Did you get it to work? I got the same error.
— Reply to this email directly or view it on GitHub https://github.com/mapbox/tilemill-reference-layer/issues/11#issuecomment-54640562 .
I did a workaround (I removed my urls since they are internal)
diff --git a/views/Map.bones b/views/Map.bones
index ff05079..4197b49 100644
--- a/views/Map.bones
+++ b/views/Map.bones
@@ -40,6 +40,26 @@ view.prototype.render = function(init) {
// Indentify which layer is the TileMill layer
this.map.tmLayer = 0;
+var tilejson_base = {
+ tilejson: '1.0.0',
+ scheme: 'xyz',
+ tiles: ['your_base_url_here'],
+ "minzoom": 0,
+ "maxzoom": 20
+};
+var tilejson_labels = {
+ tilejson: '1.0.0',
+ scheme: 'xyz',
+ tiles: ['your_labels_url_here'],
+ "minzoom": 0,
+ "maxzoom": 20
+};
+
+
+this.map.insertLayerAt(0, new wax.mm.connector(tilejson_base));
+this.map.insertLayerAt(2, new wax.mm.connector(tilejson_labels));
+this.map.tmLayer=1;
+/*
// Get remote map endpoint
var basemap = (this.model.get('_basemap'));
if (basemap) {
@@ -49,14 +69,13 @@ view.prototype.render = function(init) {
if (basemap.match(/^[^/.]+\.[^/.]+$/)) {
basemap = this.model.mapboxTileJSON(basemap);
}
-
wax.tilejson(basemap, _(function(tilejson) {
// Insert remote map as a layer
this.map.insertLayerAt(0, new wax.mm.connector(tilejson));
this.map.tmLayer = 1; // Indicate that the TileMill layer has changed
}).bind(this));
}
-
+*/
Ran into something similar using mapbox.js and will record here in case it's of use to anyone. Have a hunch that the problem here is w/ retina displays:
L.mapbox.tileLayer(layerJSON)
appends @2x to tile urls automatically, which obviously won't work w/ tileservers not configured to generate 2x tiles.@pakore 's workaround to hardcode the tile url templates is a good fix. Thanks.
don't have access to a non-retina display at the moment, so can't fully verify. will post when I do.
Been trying to get this plugin to work w/ my own TileJSON reference but am getting the following error:
My TileJSON definition is hosted here, which is CORS supported.
I did have luck using the TileJSON url w/ mapbox.js, so I don't think it's an error w/ the definition. And the plugin did work with a MapBox TileJSON url (tried with this). Any thoughts?
Really useful plugin--allows me to style transparent data overlay layers on top of my base layer w/o having to define the whole baselayer w/i the data overlay project. Thanks.