gm3
gm3 copied to clipboard
Add doc/examples on style options
Expand demo to show color by expression in style def:
<map-source name="places" type="geojson" title="Cities and Villages" >
<url>./places.geojson</url>
<layer name="default">
<style><![CDATA[
{
"fill-opacity": 0.60,
"fill-color" : [
"match",
["get","name"],
"Hastings",
"red",
"Bloomington",
"green",
"grey"
],
"line-width" : 5,
"text-field": ["get", "name"],
"text-allow-overlap": false
}
]]></style>
<template name="identify" auto="true" />
</layer>
</map-source>

I think it would also be useful to add in a comment the expected syntax (i.e. name is the field you're querying, specify the color for each city, specify a final color for any remaining cities not mentioned).
It may also be useful to show how to only display a few features (say you're connecting to a statewide dataset but are only interested in your region).
I was able to accomplish this by filtering the data and creating a layer for each feature (and then aggregating them together into a single layer in the catalog), though this can be a bit clunky.
<layer name="Layer 1" selectable="true">
<style><![CDATA[
{
"line-color" : "#002474",
"line-width" : 2,
"fill-color": "#37a800",
"fill-opacity": 0.20
}
]]>
</style>
<filter><![CDATA[
["==", "instName", "Lincoln County"]
]]>
</filter>
<template name="identify" auto = "true" />
</layer>
Good idea. Comments can be hard in our hybrid XML/CDATA/json, but perhaps a block comment showing the first object's property names and values would be helpful.
And yes, more doc on the filters.
@brentfraser @chughes-lincoln please assign me I want to work on this issue..
@draunger Hi! Please send an email to the Geomoose-users mailing list introducing yourself and describing your interest in GeoMoose. Thanks!