Tag Info

New answers tagged

0

There's possibly a couple of things going on here: If you're using the default style then you'll be loading the vector data from Mapbox. You'll probably want to be using a local datasource which is harder to setup (in comparison to Tilemill) but not impossible If you are using a local tile source, then you'll need to edit the mapnik XML first - mapbox ...


0

Use the setStyle() method to set the style for all features, and use the eachLayer() method to set the style by feature. So, something like: var jsonLayer = L.mapbox.featureLayer(geoJson).addTo(map); // set style for all features jsonLayer.setStyle({stroke: '#555555', strokewidth: 1}); // set style by feature ...


1

Actually you can do it by using redraw(), all you need to do is change the style of the layer first, then call the redraw function. //reset the style of the layer to the style you defined layer.style = newStyle; //then redraw the layer layer.redraw(); I created an example here on JSFiddle that does exactly what you are looking for.


1

The options for saving styles are text based files, qml looks like xml format and sld looks like html. Using a text editor would allow you build a new style for your point file from the values saved from the polygon file by cut and paste.


4

"probably because I'm trying to export something that represent a polygon to a point" Bingo! Polygon shapefiles tend to use Fills by default with a set of styles (size, colour, etc). Point shapefiles tend to use Markers by default with a set of styles (size, colour, etc). So both shapefiles use a different type of symbology. Hope this helps!


2

You can use a stylemap and context-functions to set different styles for your features. var your_context = { getColor: function (feature) { if (feature.attributes.id == 1) { return "red"; } else if (feature.attributes.id == 2) { return "blue"; } else if (feature.attributes.id == 3) ...


2

In QGIS go to Layer Properties -> Style. Either use 'Categorized' if you have a few values, 'Graduated' to be based on all the values (size is under the advanced menu) or create your own rules using 'Rule-based'. See HERE for duplicate question (comment from Joseph).



Top 50 recent answers are included