[Geoserver-users] Labels not grouping, repeating over the map

Hi!

Serving my own street layers (shapefiles) on top of google maps (satellite
view) and google earth just fine. (WFS) :slight_smile:

1.- Im Using the <VendorOption name="group">yes</VendorOption> in both the
street and city layers; With the streets layer the label placement works ok
(one label per street) but city layer ignores the grouping instruction and
displays names more than once (6 or 7). :frowning:

2.- The other thing is that I would like to place the city label in an
specific location of the map, let´s say, in the upper left corner, next to
the zoom control, and have no idea on how to do that. :frowning:

Suggestions? ... Thanks !
--
View this message in context: http://www.nabble.com/Labels-not-grouping%2C-repeating-over-the-map-tf2759240.html#a7693165
Sent from the GeoServer - User mailing list archive at Nabble.com.

GPSBoy escreveu:

Hi!

Serving my own street layers (shapefiles) on top of google maps (satellite
view) and google earth just fine. (WFS) :slight_smile:

1.- Im Using the <VendorOption name="group">yes</VendorOption> in both the
street and city layers; With the streets layer the label placement works ok
(one label per street) but city layer ignores the grouping instruction and
displays names more than once (6 or 7). :frowning:

2.- The other thing is that I would like to place the city label in an
specific location of the map, let´s say, in the upper left corner, next to
the zoom control, and have no idea on how to do that. :frowning:

Suggestions? ... Thanks !
  

I have a sugestion for (1):
Try to use <VendorOption name="group">true</VendorOption> instead of <VendorOption name="group">yes</VendorOption>.

Cheers,
Eduardo

GPSBoy wrote:

Hi!

Serving my own street layers (shapefiles) on top of google maps (satellite
view) and google earth just fine. (WFS) :slight_smile:

1.- Im Using the <VendorOption name="group">yes</VendorOption> in both the
street and city layers; With the streets layer the label placement works ok
(one label per street) but city layer ignores the grouping instruction and
displays names more than once (6 or 7). :frowning:

Are city layers polygons or lines? I think the vendor group option only works for lines, I was noticing that behavior myself last night. The docs say that it should do grouping:

polygons are (a) clipped to the view rectangle (b) the centroid of the largest polygon is used.

http://docs.codehaus.org/display/GEOSDOC/LabelingOptions

   If it's polygons could you submit a bug to our tracker at: http://jira.codehaus.org/browse/GEOS ?

2.- The other thing is that I would like to place the city label in an
specific location of the map, let´s say, in the upper left corner, next to
the zoom control, and have no idea on how to do that. :frowning:

Next to the zoom control? Like you always want it next to the zoom control? Even when someone moves around or zooms in? That's hard to do, since the zoom control isn't really an element of the map GeoServer produces, so it doesn't know where it is. If you really wanted it right by the zoom control then I'd write it in to the client. Have the client make a WFS GetFeature request to figure out what city was being viewed (simple way is just do a GetFeature for the center of the map, you could get in to more complicated algorithms though, for cases when multiple cities are on the map, ect.) And then display the results next to the zoom.

If you're using google maps then you'll have to write some javascript code to make the request and to put the results on top of the map (or it might be easier to do it just outside? I'm not sure). There's info on how to make WFS requests in javascript at: http://docs.codehaus.org/display/MAP/Step+3+Set+Up+Queries

best regards,

Chris

Suggestions? ... Thanks !

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Thanks Chris!

Are city layers polygons or lines? I think the vendor group option only
works for lines, I was noticing that behavior myself last night. The
docs say that it should do grouping:
polygons are (a) clipped to the view rectangle (b) the centroid of the
largest polygon is used.

Layer Provinces : Polygon
Layer County: Polygon
Layer Towns: Point

2.- The other thing is that I would like to place the city label in an
specific location of the map, let´s say, in the upper left corner, next
to
the zoom control, and have no idea on how to do that. :frowning:

Next to the zoom control? Like you always want it next to the zoom
control? Even when someone moves around or zooms in? That's hard to
do, since the zoom control isn't really an element of the map GeoServer
produces, so it doesn't know where it is. If you really wanted it right
by the zoom control then I'd write it in to the client. Have the client
make a WFS GetFeature request to figure out what city was being viewed
(simple way is just do a GetFeature for the center of the map, you could
get in to more complicated algorithms though, for cases when multiple
cities are on the map, ect.) And then display the results next to the
zoom.

If you're using google maps then you'll have to write some javascript
code to make the request and to put the results on top of the map (or it
might be easier to do it just outside? I'm not sure). There's info on
how to make WFS requests in javascript at:
http://docs.codehaus.org/display/MAP/Step+3+Set+Up+Queries

Im using Google Maps, and when I said next to the zoom control is to
give you an idea of what could be anywhere, top left, bottom right,
doesn't matter, just want the names displayed like in an specific area,
city name and below province name, when you move the map, it goes back
to the same spot, let's say, xxxx pixels, yyyyyy pixels from the upper left
corner
of the map.

Eduardo:

Try to use <VendorOption name="group">true</VendorOption> instead of
<VendorOption name="group">yes</VendorOption>.

No luck with the true value for the VendorOption

Thank you guys ! any other suggestions?
--
View this message in context: http://www.nabble.com/Labels-not-grouping%2C-repeating-over-the-map-tf2759240.html#a7706181
Sent from the GeoServer - User mailing list archive at Nabble.com.