[OpenLayers-Users] OpenLayers feature labeling - not working
anymore
3Deography.net
info at 3deography.net
Thu Oct 22 11:08:50 EDT 2009
I spent a looooot of time, searching this needle in the haystack :-(
I tried to get this example running (again):
http://openlayers.org/dev/examples/vector-features-with-text.html
Works fine on my Tomcat6 - but the strange behaviour is: If I rename the
test.html to test.jsp and insert <% out.println("Hello World"); %>, it
doesn't work anymore. Any ideas?
3Deography.net wrote:
>
> Hi,
>
> I just migrated from apache/mysql to tomcat/postgresql and everything's
> working fine - except 1 thing:
>
> I use custom style types to visualize spatial db-data and want to label
> features on a vector layer. The label can be found within the features
> attributes. But this won't work anymore. Any ideas?
> The styleMap itself works because if I use a static string, it affects the
> right features/layer and labels them. The attribute "style_map" exists as
> the unique values for styling are switched, based on this field. If i try,
> "title"... nothing changes.
>
> Somehow, the labelling ${attribute_fiels} won't work. Any help would be
> appreciated as I am stuck right now :-(
>
>
> var styleMap = new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults({
> fillOpacity: 0.7,
> strokeColor: "black"},
> OpenLayers.Feature.Vector.style["default"])
> );
>
> var style_types = {
> "gazetteer": {
> labelAlign: 'lb',
> label: "${style_type}",
> fontSize: "10px",
> fontColor: 'white',
> pointRadius: 3
> }
> }
>
> styleMap.addUniqueValueRules("default", "style_type", style_types);
>
> And here how the sample feature is passed by:
>
> ...{ "type":
> "Feature","properties":"title":"Germany","featureType":"country","style_type":"gazetteer","tooltip":"wiki"},...
>
> The fields title and style_type definitely exist and contain values ;-)
>
> Regards,
> Martin
>
--
View this message in context: http://n2.nabble.com/OpenLayers-feature-labeling-not-working-anymore-tp3871085p3872886.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list