[Mapbender-users] Digitizer : different color for the objects
Astrid Emde
astrid.emde at wheregroup.com
Sun Jun 24 02:47:51 PDT 2018
Hello Gérald,
you can do this easily as you can use die OpenLayers 2 styles in the
digitizer.
See OpenLayer 2 styles documentation:
http://docs.openlayers.org/library/feature_styling.html
You should add a new column for the color in your table, that you fill
depending on the choice of the user.
f.e.
Alter table poi add column color varchar;
As Mapbender does not support combo you could choose a selectbox for
the different types.
Add the selectbox to your digitizer configuration:
f.e.
-
type: select
title: Type
name: color
options:
'#ff00ff': Type-A
'#00ffff': Type-B
'#ffff00': Type-C
'#00ff00': Type-D
Styles could look like this - with ${color} you refer to the new column
with the color values
styles:
default:
strokeWidth: 2
strokeColor: '#0e6a9e'
fillColor: ${color}
fillOpacity: 1
fillWidth: 2
pointRadius: 10
select:
strokeWidth: 3
strokeColor: ${color}
fillOpacity: 0.7
pointRadius: 10
Happy cycling!
Astrid
Am 2018-06-23 17:00, schrieb Gérald Salin:
> Hi mapbender users,
> we (a french cyclist association, bicycle as a way of transport)
> would like to use mapbender to allow cyclists to draw lines on a map
> of the most important cyclable axes which they think is missing. We
> are still evaluating mapbender. I already posted a message few weeks
> ago and are still evaluate mapbender.
> We would like to associate a type (combo with 3 items in the form) to
> the lines added by the cyclists, and visually differentiate them on
> the map.
>
> do you know if there is a way to associate a color to each type so
> that the lines appear differently on the map?
>
> Thank you for your help
>
> Gérald--
>
> VelObs : remontez vos problèmes lors des déplacements à vélo sur
> le web [1] ou sur android [2] (une appli 2P2R [3])
> Pedibus labégeois [4]
> Soutenez ICEA [5], Inititiative Citoyenne pour une Energie
> Alternative, prenez ou offrez des parts sociales pour devenir
> co-propriétaire de panneaux photovoltaïques
> Consommez de l'énergie éléctrique verte renouvelable avec ENERCOOP
> [6]
>
>
>
> Links:
> ------
> [1] https://velobs.2p2r.org/
> [2]
> https://play.google.com/store/apps/details?id=org.deuxpiedsdeuxroues.velobs.tlse&hl=fr
> [3] https://2p2r.org/
> [4] https://emilepattesblog.wordpress.com/
> [5] http://icea-enr.fr/
> [6] http://www.enercoop.fr/
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapbender_users
--
Mit freundlichen Grüßen
Astrid Emde
Senior GIS-Consultant
-----------------------------------
Aufwind durch Wissen!
Qualifizierte Open-Source-Schulungen
bei der www.foss-academy.com
-----------------------------------
Astrid Emde
WhereGroup GmbH & Co.KG
Eifelstraße 7
53119 Bonn
Germany
Fon: +49(0)228 90 90 38 - 22
Fax: +49(0)228 90 90 38 - 11
astrid.emde at wheregroup.com
www.wheregroup.com
Folgen Sie der WhereGroup auf twitter:
http://twitter.com/WhereGroup_com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
-------------------------------
More information about the Mapbender_users
mailing list