Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

bez123
I've created a very simple ArcGIS Server dynamic map REST service for a single polygon layer with about 10 features. When I view the service in my OpenLayers demo app, the labels are duplicating -- that is, I'm seeing about 5 labels per feature. Not sure why. Does anyone have an idea how to prevent this label duplication? I only want one label per feature to display.

Thanks much,
Shira

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Expanding the hitbox for selectFeature?

Phil Scadden
I am finding that you need incredibly accurate clicking to selectfeature
(especially when geometry is a line). Is there away of expanding the hitbox?


Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Expanding the hitbox for selectFeature?

Alexandre Dubé
Hi Phil,

You could make the features larger by changing the 'strokeWidth'
property of your features.

Alexandre


Phil Scadden wrote:

> I am finding that you need incredibly accurate clicking to selectfeature
> (especially when geometry is a line). Is there away of expanding the hitbox?
>
>
> Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>  


--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
crb
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

crb
In reply to this post by bez123
I am seeing the same thing today with ArcGIS Server v10 SP1 REST services. I've tried several different labeling options on the server side ('Remove duplicate labels', 'Place one label per feature', 'Only place label inside polygon') but OL still displays several labels per polygon feature.  If I view the same AGS service using the AGS JavaScript API, the labels are rendered correctly, i.e. one per polygon.

Has anyone else found a workaround for this?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

Andreas Hocevar-2
Hi,

This is because OpenLayers requests tiles, and the server doesn't know
about neighboring tiles. An easy fix would be to request the content
in a single image. To do so, configure your layer with the

singleTile: true

option.

Andreas.

On Fri, Jan 20, 2012 at 12:00 AM, crb <[hidden email]> wrote:

> I am seeing the same thing today with ArcGIS Server v10 SP1 REST services.
> I've tried several different labeling options on the server side ('Remove
> duplicate labels', 'Place one label per feature', 'Only place label inside
> polygon') but OL still displays several labels per polygon feature.  If I
> view the same AGS service using the AGS JavaScript API, the labels are
> rendered correctly, i.e. one per polygon.
>
> Has anyone else found a workaround for this?
>
> Thanks in advance.
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Duplicate-labels-display-in-ArcGIS-Server-REST-map-service-when-viewing-through-OpenLayers-API-tp4902888p7205708.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
crb
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

crb
Thanks Andreas.  Much appreciated, as always.

I tried using 'singleTile: true' but it's still returning duplicate labels.  Don't think it matters, but I'm using an ArcGIS93Rest OL layer w/ ArcGIS server v10.  My OL layer is configured thus:

var ml = new OpenLayers.Layer.ArcGIS93Rest(
                        name,
                        url,
                        {
                            // params
                            'layers': 'show:0',
                            'singleTile': true,
                            'srs': map.projection,  // EPSG:102113
                            'transparent': true
                        },
                        {
                            // options
                            'alwaysInRange': true,
                            'displayInLayerSwitcher': true,
                            'isBaseLayer': false,
                            'isSelectable': false,  // custom property
                            'opacity': 0.5,
                            'visibility': false
                        }
                    );

The request that it is making to AGS has the SINGLETILE parameter in it:

http://myAgsServer/ArcGIS/rest/services/myService/MapServer/export&LAYERS=show%3A0&SINGLETILE=true&SRS=EPSG%3A102113&TRANSPARENT=true&FORMAT=png&BBOX=-11603752.382735%2C4676723.1258%2C-11564616.624259%2C4715858.884277&SIZE=256%2C256&F=image&BBOXSR=102113&IMAGESR=102113
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

Andreas Hocevar-2
Hi,

singleTile is an option, not a param of the layer. So you have to move
it from your params object literal to the options one.

Andreas.

On Tue, Feb 21, 2012 at 12:16 AM, crb <[hidden email]> wrote:

> Thanks Andreas.  Much appreciated, as always.
>
> I tried using 'singleTile: true' but it's still returning duplicate labels.
> Don't think it matters, but I'm using an ArcGIS93Rest OL layer w/ ArcGIS
> server v10.  My OL layer is configured thus:
>
> var ml = new OpenLayers.Layer.ArcGIS93Rest(
>                        name,
>                        url,
>                        {
>                            // params
>                            'layers': 'show:0',
>                            'singleTile': true,
>                            'srs': map.projection,  // EPSG:102113
>                            'transparent': true
>                        },
>                        {
>                            // options
>                            'alwaysInRange': true,
>                            'displayInLayerSwitcher': true,
>                            'isBaseLayer': false,
>                            'isSelectable': false,  // custom property
>                            'opacity': 0.5,
>                            'visibility': false
>                        }
>                    );
>
> The request that it is making to AGS has the SINGLETILE parameter in it:
>
> http://myAgsServer/ArcGIS/rest/services/myService/MapServer/export&LAYERS=show%3A0&*SINGLETILE=true*&SRS=EPSG%3A102113&TRANSPARENT=true&FORMAT=png&BBOX=-11603752.382735%2C4676723.1258%2C-11564616.624259%2C4715858.884277&SIZE=256%2C256&F=image&BBOXSR=102113&IMAGESR=102113
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Duplicate-labels-display-in-ArcGIS-Server-REST-map-service-when-viewing-through-OpenLayers-API-tp3910724p4489370.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
crb
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

crb
Thanks Andreas.

I had actually tried that, but it resulted in a broken link, i.e. a semi-transparent pink OL layer.
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

Andreas Hocevar-2
Probably because the map size was too big. Make sure the maximum map
size is big enough in your MapServer map file. You may also want to
configure the ratio option and set it to 1, instead of the 1.5 default
- this will result in a smaller map size being requested from the
server.

Andreas.

On Tue, Feb 21, 2012 at 4:06 PM, crb <[hidden email]> wrote:

> Thanks Andreas.
>
> I had actually tried that, but it resulted in a broken link, i.e. a
> semi-transparent pink OL layer.
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Duplicate-labels-display-in-ArcGIS-Server-REST-map-service-when-viewing-through-OpenLayers-API-tp3910724p4491895.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
crb
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate labels display in ArcGIS Server REST map service when viewing through OpenLayers API

crb
ratio = 1.0 did it.  thanks!