I've been learning to use TileMill, and I want to be able to copy a layer. I especially want to copy layers connecting to an SQLite or PostGIS database in order to avoid having to type in multiple inputs for each. It gets pretty tedious copying the same database and srs values multiple times. Is there a way to copy a layer?
1 Answer
Although there appears to be no method, yet, of duplicating layers within the user interface, I found it very straightforward to open up the project's .mml file and duplicate one of the layer objects. Saved a lot of time.
"Layer": [
// Just copy the data within the curly braces - including the braces
{
"geometry": "point",
"extent": [
-123.42451298990491,
44.498765231550635,
-123.23322888641141,
44.61808686876073
],
"Datasource": {
"type": "sqlite",
"file": "d:\\Projects\\test.sqlite",
"table": "Hydrant",
"extent": "",
"id": "hydrant",
"project": "test",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"
},
"id": "hydrant",
"srs-name": "custom",
"srs": "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +to_meter=0.3048 +no_defs",
"advanced": {},
"name": "hydrant"
},
]
-
1This is the most common and easiest practice for copying layers at the moment. Just make sure that you change your copy and pasted layer's name.– WillCommented Jul 13, 2013 at 19:06
-
Hi I have a similar question gis.stackexchange.com/questions/164501/…. Where can I get the .mml file?– SleepNotCommented Sep 28, 2015 at 13:27