[OpenLayers-Users] JSON format does not work in Protocol.WFS

2010-04-12 Thread paweluz

Hi!

I have been reading for a while that using JSON format is better in some
cases that using just GML (XML). I have been trying to use it, but in
firebug all the time I can see just XML not the json file... My code looks
like this:

var  wfsproba = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(),saveStrategy],
projection: new OpenLayers.Projection("EPSG:4326"),
styleMap: wfs_style, 
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4326",
url: "http://localhost/geoserver2_0_1/wfs";,
featureNS :  "http://www.openplans.org/topp";,
featureType: "bazadanych",
geometryName: "the_geom",
formatOptions: {outputFormat: 'json'}, 
readFormat: new OpenLayers.Format.GeoJSON() ,
schema:
"http://localhost/geoserver2_0_1/wfs/DescribeFeatureType?version=1.1.0&typename=topp:bazadanych";,
featurePrefix: "topp"
})

Did I make some mistake. If I understand this right In firebug I should have
response in JSON not GML?? I used Openlayers 2.9-rc2.

Can anyone please help me in this 

Regards,
Poul  


-- 
View this message in context: 
http://n2.nabble.com/JSON-format-does-not-work-in-Protocol-WFS-tp4894449p4894449.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] WMS GetFeatureInfo not returning results

2010-04-12 Thread Sarah Schuessler
Hi,

did you tried using info_format=text/plain? 
I had same problem some weeks ago and I think with that I get info back. 

HTH
best regards
Sarah





Von: Tobias Luetticke 
An: users@openlayers.org
Gesendet: Dienstag, den 13. April 2010, 6:32:01 Uhr
Betreff: [OpenLayers-Users] WMS GetFeatureInfo not returning results

Hi

I'm trying to get information back by executing a WMS GetFeatureInfo request, 
but without success. I am using the GeoServer Layer Preview function that in 
turn uses OpenLayers. 

When I click on a feature on the map eg the following request is sent (copied 
from Firebug):

http://localhost:8080/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=1929381.381188%2C5592303.911446%2C1941522.166813%2C5603614.760554&X=372&Y=170&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=test%3ATL_STANDARD_PARCEL&FEATURE_COUNT=50&Srs=EPSG%3A2193&Layers=test%3ATL_STANDARD_PARCEL&Styles=&WIDTH=512&HEIGHT=477&format=image%2Fpng

The GeoServer logs confirm that it receives the request and accesses the 
datastore. It also talks about writing to an OutputStream, but since I don't 
get any feature info back I can't judge whether that's all good or not. 
Checking Firebug for the response it confirms that HTML is streamed back from 
GeoServer, just the table that should contain the feature info is missing.

My configuration is
* GeoServer 2.0.1
* OpenLayers 2.8
* All running locally in my development sandbox
* Data coming from a shapefile data store
* GeoServer layer set to EPSG:2193 as declared SRS with SRS handling to "force 
declared". 

I have confirmed with ArcGIS Explorer that the shape file contains the 
information I'm after. When I export data from GeoServer (again Layer preview) 
as GML the attributes are in there. There doesn't seem to be anything horribly 
wrong as the borwser/GeoServer roundtrip happens successfully. I guess 
somewhere I wired things wrongly together such that the request comes back 
empty.

Oddly enough, the GeoServer provided layer of US States (that uses shapefiles 
also) shows the same behaviour. However, on another GeoServer installation that 
shows the same configuration data comes back and a table showing the feature 
information is displayed.

What am I missing? Any ideas much appreciated.

Cheers
Tobias



This e-mail message and attachments do not necessarily reflect the views of 
the New Zealand Ministry of Justice and may contain 
information that is confidential and may be subject to legal privilege. If you 
are not the intended recipient, you are hereby notified that you must not use, 
disseminate, distribute or copy this e-mail message or its attachments. If you 
received this message in error, please notify the Ministry of Justice 
by telephone (call collect: 00-64-4-918-8800) or return the 
original message to us by e-mail, and destroy any copies.
Thank you.


___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.com ___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] draw feature example

2010-04-12 Thread Eric Lemoine
On Mon, Apr 12, 2010 at 3:42 PM, sunny74  wrote:
>
> Hi,
>
> Thanks for your reply.
>
> So if I draw a polygon the how can I get some information about the features
> covered by the polygon.
> Atleast the feature name or the lonlat so that using the lonlat I am able to
> make a GFI request.

You can use WFS.

Create an "intersects" (or "contains") spatial with filter. See
.
And send this filter through a WFS protocol. See the wfs-protocol.html
example to know how to create a WFS protocol. To send the filter you'd
use protocol.read({filter: yourSpatialFilter}).

Hope it helps,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] WMS GetFeatureInfo not returning results

2010-04-12 Thread Tobias Luetticke
Hi

I'm trying to get information back by executing a WMS GetFeatureInfo request, 
but without success. I am using the GeoServer Layer Preview function that in 
turn uses OpenLayers. 

When I click on a feature on the map eg the following request is sent (copied 
from Firebug):

http://localhost:8080/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=1929381.381188%2C5592303.911446%2C1941522.166813%2C5603614.760554&X=372&Y=170&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=test%3ATL_STANDARD_PARCEL&FEATURE_COUNT=50&Srs=EPSG%3A2193&Layers=test%3ATL_STANDARD_PARCEL&Styles=&WIDTH=512&HEIGHT=477&format=image%2Fpng

The GeoServer logs confirm that it receives the request and accesses the 
datastore. It also talks about writing to an OutputStream, but since I don't 
get any feature info back I can't judge whether that's all good or not. 
Checking Firebug for the response it confirms that HTML is streamed back from 
GeoServer, just the table that should contain the feature info is missing.

My configuration is
* GeoServer 2.0.1
* OpenLayers 2.8
* All running locally in my development sandbox
* Data coming from a shapefile data store
* GeoServer layer set to EPSG:2193 as declared SRS with SRS handling to "force 
declared". 

I have confirmed with ArcGIS Explorer that the shape file contains the 
information I'm after. When I export data from GeoServer (again Layer preview) 
as GML the attributes are in there. There doesn't seem to be anything horribly 
wrong as the borwser/GeoServer roundtrip happens successfully. I guess 
somewhere I wired things wrongly together such that the request comes back 
empty.

Oddly enough, the GeoServer provided layer of US States (that uses shapefiles 
also) shows the same behaviour. However, on another GeoServer installation that 
shows the same configuration data comes back and a table showing the feature 
information is displayed.

What am I missing? Any ideas much appreciated.

Cheers
Tobias



This e-mail message and attachments do not necessarily reflect the views of 
the New Zealand Ministry of Justice and may contain 
information that is confidential and may be subject to legal privilege. If you 
are not the intended recipient, you are hereby notified that you must not use, 
disseminate, distribute or copy this e-mail message or its attachments. If you 
received this message in error, please notify the Ministry of Justice 
by telephone (call collect: 00-64-4-918-8800) or return the 
original message to us by e-mail, and destroy any copies.
Thank you.


___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Vector labels at different zoom levels

2010-04-12 Thread Arnd Wippermann
Hi Jeff,
 
that's the styleMap I use to get the effect. Still in IE the labels with the
font-size = 0px will drawn in very small letters?!
 
Labels are a function of the zoomlevel (context) and the features are a
function of the attribute popClass (UniqueValueRules).
 
var styleMapCapitols;
 
function setStyleMapCapitols()
{
var context = {
getFontSize : function(ft){
 
var diffZ = map.getZoom() - 4;
var popclass = parseInt(ft.attributes.popclass);
 
if(popclass > 10 && map.getZoom() > 1)
return(map.getZoom() + 7 + "px");
else if(diffZ > 0 && popclass>9)
return (10 + 1*diffZ +"px")
else if(diffZ > 0)
return (8 + 1*diffZ +"px")
else
return("0px");
},
getName : function (ft){
return ft.attributes.name;
}
};
var template = {
strokeColor: "#FF",
strokeOpacity: 1,
strokeWidth: 3,
fillColor: "#00AAFF",
fillOpacity: 1,
pointRadius: 5,
pointerEvents: "visiblePainted",
 
label : "${getName}",
 
labelOffsetX: "10",
labelOffsetY: "-10",
fontColor: "red",
fontSize: "${getFontSize}",
fontFamily: "Arial",
fontWeight: "bold",
labelAlign: "lt"
};
styleMapCapitols = new OpenLayers.StyleMap(new
OpenLayers.Style(template, {context:context}) );
 
var tata = {fillColor: '#FFAADD', pointRadius: 5, label :
"${getName}",labelOffsetX: "10",labelOffsetY: "20",fontColor:
"yellow",fontSize: "${getFontSize}",fontFamily: "Arial",fontWeight:
"bold",labelAlign: "lt"}
 
var popArrO = [0.5  , 0.5  , 0.5  , 0.5  , 0.5  ,
0.5  , 0.5  , 0.5  , 0.75 , 0.75 , 0.75];
var popArrW = [1, 1, 1, 1, 1, 1
, 2, 2, 2, 2, 2 ];
var popArrR = [2, 2, 3, 3, 4, 4
, 5, 5, 6, 7, 10];
var popArrC = ['#00', '#00FF00', '#AA00FF', '#FF', '#FF8800',
'#FF', '#FF', '#AAFFAA', '#FF', '#FF00FF', '#FF00AA'];
 
var lookup = {};  //popclass beginnt mit 1!
for(var i=0;i<11;i++)
lookup[i+1]= new OpenLayers.Util.applyDefaults({pointRadius:
popArrR[i], fillColor: popArrC[i], fillOpacity: popArrO[i], strokeWidth:
popArrW[i], strokeColor: popArrC[i]}, tata);
 
styleMapCapitols.addUniqueValueRules("default", "popclass", lookup);
}
setStyleMapCapitols();

an example:
http://gis.ibbeck.de/OLClient/OLClient.asp?KARTE=k1
 
Arnd

  _  

Von: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] Im
Auftrag von Jeff Dege
Gesendet: Montag, 12. April 2010 22:19
An: users@openlayers.org
Betreff: [OpenLayers-Users] Vector labels at different zoom levels



I'm adding some attributes to the GML data I'm using to draw a vector layer,
and have set the label member of the style object to display those
attributes.

 

It works fine, except that it looks lousy when I zoom out.  The labels are
still drawn the same, even though the features may be nearly invisible.

 

How do I turn off the rendering of labels, when the scale exceeds some
threshold?  (Note - I still want to draw the features, I simply don't want
the labels.)

 

I've tried adding a listener to map.movestart, that changes the value of
layer.styleMap.styles['default'.defaultStyle.label, but that only affects
future renderings of the map, it has no effect on the current zoom.

 

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Problem with images when put OpenLayers.js in local path

2010-04-12 Thread Lisa Gaudette

>From the .zip or .tar download file, you're going to want the following
files/directories in the same directory for all the default images:
OpenLayers.js
img/
theme/  (with a subdirectory of default, which has more image and css files)
style.css (not sure this is necessary)

I suspect you're missing the theme folder.
-- 
View this message in context: 
http://n2.nabble.com/Problem-with-images-when-put-OpenLayers-js-in-local-path-tp4864118p4892579.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] What is best way to provides maps without access to internet?

2010-04-12 Thread Lisa Gaudette

It's possible to just load images - OpenLayers.Layer.Image, but this can get
finicky if you need to properly georeference and line things up, or allow
for much zooming. It is possible to do some of those things it just gets
painful :)


MostlyBaldEagle wrote:
> I guess I could run a map server locally, which for some customers is not
> a preferred option as they want to provide their own map images. 

There's no reason you couldn't set up a WMS (e.g. MapServer) or something
else locally with the user's own images.

Another option depending on the kind of data is to look at TMS made with
Maptiler/Gdal2tiles - those tools break a big image into a directory
structure of tiles with various zoom levels etc.
-- 
View this message in context: 
http://n2.nabble.com/What-is-best-way-to-provides-maps-without-access-to-internet-tp4874368p4892525.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] Vector labels at different zoom levels

2010-04-12 Thread Jeff Dege
I'm adding some attributes to the GML data I'm using to draw a vector layer, 
and have set the label member of the style object to display those attributes.

It works fine, except that it looks lousy when I zoom out.  The labels are 
still drawn the same, even though the features may be nearly invisible.

How do I turn off the rendering of labels, when the scale exceeds some 
threshold?  (Note - I still want to draw the features, I simply don't want the 
labels.)

I've tried adding a listener to map.movestart, that changes the value of 
layer.styleMap.styles['default'.defaultStyle.label, but that only affects 
future renderings of the map, it has no effect on the current zoom.

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)

2010-04-12 Thread Andreas Hocevar
On 2010-04-12 20:30 , chandanpansare wrote:
> I have multiple vector layers added in map and for each layer I have
> SelectFeature control.
> In IE, Chrome and Safari I'm able to select features of all the layers but
> in case of FireFox only features from the last layer added are accessible.
> would like to if there any work around / solution for this or is it a known
> issue?
> Any help will be greatly appreciated.
>

You only need one SelectFeature control for all your layers. Configure 
it with an array of your layers, instead of just one layer.

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] Multiple Vector Layers (FireFox issue)

2010-04-12 Thread chandanpansare

I have multiple vector layers added in map and for each layer I have
SelectFeature control.
In IE, Chrome and Safari I'm able to select features of all the layers but
in case of FireFox only features from the last layer added are accessible.
would like to if there any work around / solution for this or is it a known
issue?
Any help will be greatly appreciated. 
-- 
View this message in context: 
http://n2.nabble.com/Multiple-Vector-Layers-FireFox-issue-tp4891837p4891837.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] OpenLayer OSM, how do i rotate a picture? (and a good way to position it)

2010-04-12 Thread Arnd Wippermann
Hi,

You can add your image as a point feature on a vector layer using
externalGraphic.

http://gis.ibbeck.de/ginfo/apps/OLExamples/OL27/examples/ExternalGraphicOver
lay/ExternalGraphicOverlay.asp

The tricky part is to calculate the position and extent of the image if you
zoom in or out. But that can be solved by using a styleMap with context.

Arnd

-Ursprüngliche Nachricht-
Von: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] Im
Auftrag von Atl
Gesendet: Montag, 12. April 2010 15:32
An: users@openlayers.org
Betreff: [OpenLayers-Users] OpenLayer OSM, how do i rotate a picture? (and a
good way to position it)


Hey

Im trying to place a picture (floorplan of a building) on top of OSM, but i
run into some problems.
- I need to rotate the picture
- Find a good way to position the picture on top of the map. (im currently
just placing the picture at a given coordinate). I think of something like
upper left of picture has coordinates 0,0 (the start) and placed at
10.1, 10.11212 and rotated 34 deg. But i dont find a good way to
implement it this way.

Or am i approaching the problem all wrong?

Any tips, hints, hacks, code or reference is much welcome. thanks

//Atl
--
View this message in context:
http://n2.nabble.com/OpenLayer-OSM-how-do-i-rotate-a-picture-and-a-good-way-
to-position-it-tp4890040p4890040.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] draw feature example

2010-04-12 Thread sunny74

Hi,

Thanks for your reply.

So if I draw a polygon the how can I get some information about the features
covered by the polygon.
Atleast the feature name or the lonlat so that using the lonlat I am able to
make a GFI request.

Thanks.
-- 
View this message in context: 
http://n2.nabble.com/draw-feature-example-tp4888794p4890389.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] OpenLayer OSM, how do i rotate a picture? (and a good way to position it)

2010-04-12 Thread Atl

Hey

Im trying to place a picture (floorplan of a building) on top of OSM, but i
run into some problems.
- I need to rotate the picture
- Find a good way to position the picture on top of the map. (im currently
just placing the picture at a given coordinate). I think of something like
upper left of picture has coordinates 0,0 (the start) and placed at
10.1, 10.11212 and rotated 34 deg. But i dont find a good way to
implement it this way.

Or am i approaching the problem all wrong?

Any tips, hints, hacks, code or reference is much welcome. thanks

//Atl
-- 
View this message in context: 
http://n2.nabble.com/OpenLayer-OSM-how-do-i-rotate-a-picture-and-a-good-way-to-position-it-tp4890040p4890040.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Eric Lemoine
On Monday, April 12, 2010, Chris Green  wrote:
> Hi Eric
>
> Thanks for your suggestion but unfortunately it doesn't help - I tried to
> destroy the SelectFeature Control (testing if null first) before destroying
> the vector layer, but there was no change to the problem - I still get
> 'zIndex is null' errors each of the even number of times that I call it.

I'd add a breakpoint in setZIndex to know when it's called and what calls it.

Providing a live example would help me and others help you.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Chris Green
Hi Eric

Thanks for your suggestion but unfortunately it doesn't help - I tried to
destroy the SelectFeature Control (testing if null first) before destroying
the vector layer, but there was no change to the problem - I still get
'zIndex is null' errors each of the even number of times that I call it. 

Is there some other way, for example forcing the zIndex to be some arbitrary
value before destroying the layer? I have been trying to devise something on
those lines but have not found a workable method up to now.


Chris


-Original Message-
From: Eric Lemoine [mailto:eric.lemo...@camptocamp.com] 
Sent: 12 April 2010 10:35
To: chris.gr...@ibstv.co.uk
Cc: users@openlayers.org
Subject: Re: [OpenLayers-Users] vector layer destroyed twice throws error

On Mon, Apr 12, 2010 at 10:16 AM, Chris Green 
wrote:
> Hi Eric
>
> The code I am using (slightly simplified) is below. I am not calling
> getZIndex, I have been assuming that it is called somehow as part of the
> layer.destroy() function

Layer.destroy() doesn't call getZIndex. What calls getZIndex is the
Feature handler (used in the SelectFeature control). Before destroying
the layer you can try to destroy the SelectFeature control attached to
that layer.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com


___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Eric Lemoine
On Mon, Apr 12, 2010 at 10:16 AM, Chris Green  wrote:
> Hi Eric
>
> The code I am using (slightly simplified) is below. I am not calling
> getZIndex, I have been assuming that it is called somehow as part of the
> layer.destroy() function

Layer.destroy() doesn't call getZIndex. What calls getZIndex is the
Feature handler (used in the SelectFeature control). Before destroying
the layer you can try to destroy the SelectFeature control attached to
that layer.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Chris Green
Hi Eric

The code I am using (slightly simplified) is below. I am not calling
getZIndex, I have been assuming that it is called somehow as part of the
layer.destroy() function. The other relevant piece of information is that if
I repeat the layer.destroy() call I get the div is null error only on even
numbers: so first time is OK, 2nd time error, 3rd time OK again, 4th time
erroretc.

  

cityWFS = new OpenLayers.Layer.Vector("Cities", {
styleMap: cityStyle,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.WFS.v1_1_0({
url:
"http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apps/NewStart/htdocs/citie
s.map",
featureType: "Cities",
info_format: 'text',
hover: true,
maxFeatures: 100,
filter: cityFilter,
featureNS: "http://mapserver.gis.umn.edu/mapserver";
  })  //protocol
});
   
 if (cityHover==null){   
 
 var cityHover = new OpenLayers.Control.SelectFeature(cityWFS, {
 hover: true,
 highlightOnly: true,
   overFeature: function(feature) {
   
"some code"
   },
   
  outFeature: function(feature) {
  }
"more code"
}); 
 
} 
  
   
 map.addControl(cityHover);
 cityHover.activate();
  
 map.addLayer(cityWFS);
  

 

-Original Message-
From: Eric Lemoine [mailto:eric.lemo...@camptocamp.com] 
Sent: 12 April 2010 09:38
To: chris.gr...@ibstv.co.uk
Cc: users@openlayers.org
Subject: Re: [OpenLayers-Users] vector layer destroyed twice throws error

On Mon, Apr 12, 2010 at 8:13 AM, Chris Green 
wrote:
> Hello List
>
>
>
> I am using OL 2.8 and have a vector layer that is populated with features
> via WFS. In my application I  need to be able to remove and re-create the
> vector layer repeatedly, which I can perform once only  but the second
time
> I call layer.detroy() I get the error ‘this div is null’ thrown by the
> getZIndex function in Layer.js.

The error indicates that getZIndex is called on a destroyed layer. Is
it your code that calls getZIndex?

Cheers,
-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com


___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Problem while adding a vector layer

2010-04-12 Thread Eric Lemoine
On Thu, Apr 8, 2010 at 8:38 AM, usha madhuri  wrote:
>
> I am doing a project using Openlayers API with Google Maps as my base layer.
> I got a problem while adding a  vector layer(kml layer) or even just a
> linestring on google maps(base layer on openlayers API). The vector layer is
> not fixed with the map and moving while I am panning the map. I have tried
> different combinations but couldn't end up with a proper solution.

Hi.

You should use sphericalMercator. See:


Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Success! and one minor quirk :)

2010-04-12 Thread Eric Lemoine
On Fri, Apr 9, 2010 at 5:05 AM, Stephen Woodbridge
 wrote:
> Hi Eric,
>
> Sorry for the very long delay in getting back to this, but life happens
> regardless of code :) Questions inline below ...
>
> Eric Lemoine wrote:
>>
>> On Wed, Mar 17, 2010 at 6:30 AM, Stephen Woodbridge
>>  wrote:
>>>
>>> Hi Eric and all,
>>>
>>> Thank you for your time and advice on this project, I think I finally
>>> have almost everything working. There is still some clean up to do and a
>>> few quirks that I'm not sure about. Oh and I need to add a user login so
>>> different users edits are kept separate, but that is just some minor
>>> coding at this point. Currently all edits are made to a test user table.
>>>
>>>
>>> http://imaptools.com:8080/tilecache/test.html?zoom=17&lat=33.89595&lon=35.49935&layers=BT
>>>
>>> So the one major annoyance left which I'm not sure what the issue is, is
>>> that, if I edit POI and say change its "type" or its "name" fields the
>>> POI on the vector layer should be destroyed and the new feature added
>>> back into the layer. This is in fact happening, BUT the display of the
>>> feature is not getting updated! until I click on the POI again.
>>>
>>> For example:
>>>
>>> 1) click left most tool
>>> 2) select the "TEST" (or any) POI near the center of the viewport
>>> 3) change its type and/or its name
>>> 4) click [Save]
>>> 5) notice the POI has not changed
>>> 6) click it once and it changes
>>> 7) click it again and the popup opens
>>>
>>> the protocol callback function is at line 422 of test.html and seems to
>>> be doing the right thing except updating the layer when the a feature is
>>> updated.
>>
>> I think the callback function is not called at all. Have you tried to
>> put a break point in this function? I think it's not called because
>> the save strategy gives protocol.commit its own callback. Instead of
>> setting "callback" in the protocol config, you should register
>> listeners to the save strategy's "success" and "fail" events, and do
>> the work there.
>
> You are correct the callback is not getting called. So if I understand you
> suggestion correctly it would consist of doing something like this:
>
> Openlayers.Request.events.on({
>  success: function(event){ ... do something here ... },
>  failure: function(event){ ... report problem here ... }
> });

Hi Stephen

no, I'm saying you can register to the save strategy's "sucess" and
"fail" events.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] dynamic layer choosing to get attributes

2010-04-12 Thread Eric Lemoine
On Fri, Apr 9, 2010 at 1:36 PM, Sarah Schuessler  wrote:
> Hi list,
>
> is there a best practice for choosing a layer:
> I have different layer and for one of them I want to get attribute data. By
> now I 'choose' my layer with a GeoExt.data.FeatureStore and a
> OpenLayers.Protocol.WFS.
> I would think of either a window, panel,.. that appears if user have clicked
> on a button choosing the right layer with a combobox, .. or take the checked
> radiobutton at tree to make a getfeatureinfo request. Then the attribute
> data appear at a grid.
>
> What`s the best, easiest?
> Anybody has an example page or a hint?

Sarah, I think the GeoExt mailing would be more appropriate for that
question. Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] draw feature example

2010-04-12 Thread Eric Lemoine
On Mon, Apr 12, 2010 at 8:35 AM, sunny74  wrote:
>
> Dear Friends,
>
> There is a draw feature  example which shows drawing a point,line and
> polygon layer.
> But there is no example on drawing a circle with a fixed radius or an
> ellipse with a fixed a,b.
> I want to draw a circle or ellipse around the point of click.
> Assuming that there is a way of drawing them,I need to have the following
> info:
> 1)GetFeatureInfo of all features contained within the circle/ellipse.
> 2)GetFeatureInfo of all features intersecting the circle/ellipse.
> 3) GetFeatureInfo of all features outside the circle/ellipse.
>
> How to do the above?

Hi. You can draw regular polygons with the RegularPolygon handler. See
the regular-polygons.html example. You won't be able to use WMS
GetFeatureInfo to get features outside of/contained in/intersecting a
polygon, as GetFeatureInfo only supports x, y parameters. You may want
to look at what WFS GetFeature can provide you.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Eric Lemoine
On Mon, Apr 12, 2010 at 8:13 AM, Chris Green  wrote:
> Hello List
>
>
>
> I am using OL 2.8 and have a vector layer that is populated with features
> via WFS. In my application I  need to be able to remove and re-create the
> vector layer repeatedly, which I can perform once only  but the second time
> I call layer.detroy() I get the error ‘this div is null’ thrown by the
> getZIndex function in Layer.js.

The error indicates that getZIndex is called on a destroyed layer. Is
it your code that calls getZIndex?

Cheers,
-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] popups and z-index

2010-04-12 Thread ivan marchesini
Dear OpenLayers Users,
I'm creating a webMapping application where I'm using more than 85
layers...

my problem arises when I switch on the higher layers (86, 87, 88, an so
on...) and contemporary I click on the map to get a popup:

the popup appears under the layers!!!

It is a problem of z-index (as well explained in the openLayers FAQ) but
I can't figure which is the best way to solve this problem

Since I'm calling the popup by means of this call:
__
info_wms = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://geoserver.irpi.cnr.it/geoserver/wms', 
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(evento) {
mapPannello.map.addPopup(new
OpenLayers.Popup.FramedCloud(
"chicken", 
mappa.getLonLatFromPixel(evento.xy),
null,
evento.text,
null,
true
));
}
}
});
mappa.addControl(info_wms);
info_wms.activate();
_

 
is it possible to add to the eventListenerssomething something like
this :
viewport.getComponent('mapPannello').map.popups[0].div.style.setProperty("z-index","900")
 ?
I have tried but without success..  :-(

can you suggest me some example or some old nabble discussion about this
problem?

many thanks

Ivan





-- 
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.
http://it.wikipedia.org/wiki/Formato_aperto
http://en.wikipedia.org/wiki/Open_format

Ivan Marchesini
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" 
http://www.gfoss.it
e-mail: marches...@unipg.it
ivan.marches...@gmail.com
fax (home): +39(0)5782830887
jabber: geoiva...@jabber.org
skype: geoivan73


signature.asc
Description: Questa è una parte del messaggio firmata digitalmente
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] draw feature example

2010-04-12 Thread sunny74

Dear Friends,

There is a draw feature  example which shows drawing a point,line and
polygon layer.
But there is no example on drawing a circle with a fixed radius or an
ellipse with a fixed a,b.
I want to draw a circle or ellipse around the point of click.
Assuming that there is a way of drawing them,I need to have the following
info:
1)GetFeatureInfo of all features contained within the circle/ellipse.
2)GetFeatureInfo of all features intersecting the circle/ellipse.
3) GetFeatureInfo of all features outside the circle/ellipse.

How to do the above?

Thanks for your replies
-- 
View this message in context: 
http://n2.nabble.com/draw-feature-example-tp4888794p4888794.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] vector layer destroyed twice throws error

2010-04-12 Thread Chris Green
Hello List

 

I am using OL 2.8 and have a vector layer that is populated with features
via WFS. In my application I  need to be able to remove and re-create the
vector layer repeatedly, which I can perform once only  but the second time
I call layer.detroy() I get the error 'this div is null' thrown by the
getZIndex function in Layer.js.

 

I see that there is a ticket number 1697 that appears to relate to this but
it was raised for OL 2.6 and I don't know if it will work with 2.8 (and in
any case I am not sure how to apply patches). Can someone enlighten me about
this problem please?

 

 

Chris 

 

   

 

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] GetFeatureInfo on ASP.NET platform with MapServer finally working

2010-04-12 Thread sunny74

Dear  Friends,

This is to inform you that I had struggled  a lot to GetFeatureInfo working
on the ASP.NET platform(on windowsXP, IIS 5.1 and Visual Studio 2008).
I would like to put on record the main points of the solution so that
another guy need not have to break his head in order to get it working.
I had made several posts in order to understand the different concepts
involved in it.The posts are:


http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944
  
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 

http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944
  
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944


http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944
  
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 

http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944
  
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 

http://n2.nabble.com/getting-Feature-Info-data-directly-from-shp-files-td4767879.html#a4767879
 
http://n2.nabble.com/Get-Feature-Info-in-pop-up-working-example-td4773944.html#a4773944
  
http://n2.nabble.com/WFS-map-from-shapefiles-td4795937.html#a4795937 
http://n2.nabble.com/Proxy-problem-in-GetFeatureInfo-no-solution-td4802810.html#a4802810
 
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
http://n2.nabble.com/Opemlayers-loadURL-does-not-work-in-GetFeatureInfo-td4822969.html#a4822969
 

Initially there was confusion as to whether GetFeatureInfo can work on a WMS
layer or a WFS layer is required from MapServer.
Finally it turned out that it works on WMS layer i.e WFS is not required.
The GFI code that finally worked is as given below although there are other
similar looking code.

OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
//alert('here');
var lon = 74.25;
var lat = 20.35;
var zoom = 6;
map = new OpenLayers.Map('<%=map.ClientID%>');
//layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
//"http://localhost:9000/cgi-bin/mapserv.exe?";, {
map: '../htdocs/Shape/newwr1rec.map', layers: 'STATE', format: 'png' });
//layer1 = new OpenLayers.Layer.WMS("Rstations",
//"http://localhost:9000/cgi-bin/mapserv.exe?";, {
map: '../htdocs/Shape/newwr1rec.map', transparent: true, layers:
'RailwayStations', format: 'png' });
//alert(map);
layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
"/mapserver/mapserv.exe?map=c:/ms4w/apache/htdocs/Shape/newwr1rec.map", {
'layers': 'STATE', transparent: false, format: "image/png" });
layer1 = new OpenLayers.Layer.WMS("OpenLayers WMS",
"/mapserver/mapserv.exe?map=c:/ms4w/apache/htdocs/Shape/newwr1rec.map", {
'layers': 'RailwayStations', transparent: true, format: "image/png" });
//alert(layer);
map.addLayers([layer, layer1]);

//layer = new OpenLayers.Layer.WFS("OpenLayers WFS",
"http://127.0.0.1:9000/cgi-bin/mapserv.exe?map=d:/ms4w/apache/htdocs/Shape/newwr1.map";,
{ typename: 'STATE', maxfeatures: 6 }, { featureClass:
OpenLayers.Feature.WFS });

///map.addLayer(layer);


map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl(new OpenLayers.Control.LayerSwitcher());

map.events.register('click', map, function(e) {