Re: [OpenLayers-Users] Change mouse pointer for Zoombox control
This should happen automatically. Which OpenLayers version are you using? Which browser? Does it happen as well in the cursor example at: http://dev.openlayers.org/sandbox/bartvde/cursor/openlayers/examples/cursor.html Best regards, Bart Subha Ramakrishnan wrote: Hi , I did try out the changes made in the patch. Now, when i select the zoombox control, the mouse pointer changes to a zoombox cursor. But i am still facing the same problem.Once, i zoom in to an area using the control, the mouse pointer reverts back to the default pointer. Should i explicitly handle that event and set the mouse pointer ? Thanks for the help. Regards, Subha [EMAIL PROTECTED] wrote: Hi, see the patch at: http://trac.openlayers.org/ticket/1484 Best regards, Bart Hi, I have a question regarding mouse pointer for a zoom box control. Is it possible for me to change the mouse pointer to indicate that zoom box control is currently active. I did try setting the cursor using map.style.cursor and it does change when the zoom box control is selected, but when i zoom in to an area, the cursor goes back to the default mouse pointer. Does anyone know how to do is? Or is it available in Openlayers and i am missing it? Thanks for the help. Regards, Subha ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Bart van den Eijnden OSGIS, Open Source GIS [EMAIL PROTECTED] http://www.osgis.nl ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] GeoJSON layer and modifyFeature control
Hi Eric, I've already passed through something like this. At least the code looks similar to me. Code is below: var mycontext = { getColor: function(feature) { var jsonvalue = feature.attributes[fillcolor]; return jsonvalue; } }; var contexttemplate = { fillOpacity: 0.6, fillColor: ${getColor}, strokeColor:orange, strokeWidth:1 }; var contextStyle = new OpenLayers.Style(contexttemplate,mycontext); var myStyleMap = new OpenLayers.StyleMap({default:contextStyle}); var rules = [new OpenLayers.Rule({ symbolizer: contexttemplate, context: mycontext, elseFilter: true })]; myStyleMap.styles[default].addRules(rules); myStyleMap.styles[select].addRules(rules); (w/ or w/o this line does not work) var regions = new OpenLayers.Layer.Vector(regions,{extractAttributes:true, format: OpenLayers.Format.GeoJSON, projection: new OpenLayers.Projection(EPSG:4326), styleMap: myStyleMap}); The fill color is not changed accordingly to color I have in GeoJSON file under attribute fillcolor. All other properties in template are applied. The edit function does not work. If I remove {default:contextStyle} from OpenLayers.StyleMap( {default:contextStyle}); and we remain only with var myStyleMap = new OpenLayers.StyleMap(); and all rest of code the same, the edit function works. But still no fillcolor context is applied. I have also oversimplified the code in a separate page, but result is identical. All the best, Adorian I added the code below to the modify-feature.html example and it worked for me (code is based on Alexandre's): var tpl = { pointRadius: ${radius}, fillOpacity: 0.4, strokeColor: #00, strokeWidth: 2 }; var ctx = { context: { radius: function(feature) { return 10; } } }; var oStyle = new OpenLayers.Style(tpl, ctx); var oStyleMap = new OpenLayers.StyleMap({ default: oStyle, // works w/ or w/o the following select: new OpenLayers.Style({ fillColor: #66ccff, fillOpacity: 0.2, strokeColor: #3399ff }) }); var aoTypeColor = { '1': {fillColor:blue}, '2': {fillColor:red}, '3': {fillColor:yellow}, '4': {fillColor:white} }; oStyleMap.addUniqueValueRules(default, Type, aoTypeColor); oStyleMap.addUniqueValueRules(select, Type, aoTypeColor); var rules = [ new OpenLayers.Rule({ symbolizer: tpl, context: ctx, elseFilter: true }) ]; oStyleMap.styles[default].addRules(rules); oStyleMap.styles[select].addRules(rules); -- Eric -- Dr. Adorian Ardelean coordinator of myNature Project http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian biodiversity-database] http://mybiosis.info/nature/portal.php?pagename=adorian [CV] ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
[OpenLayers-Users] DrawFeature with callback?
Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayers ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple callback involved once the polygon are drawn, however the api mentions it's possible. As you can see from the below code the only thing I need for this little thing to work are the function that calls the alert to be picked up. Please say if you want me to elaborate further. html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); polyOptions = {sides: 4, callbacks: {function(value){alert('yeeeha');}} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions }); map.addControl(polygonControl); map.setCenter(new OpenLayers.LonLat(0, 0), 3); document.getElementById('noneToggle').checked = true; document.getElementById('irregularToggle').checked = false; } function setOptions(options) { polygonControl.handler.setOptions(options); } function setSize(fraction) { var radius = fraction * map.getExtent().getHeight(); polygonControl.handler.setOptions({radius: radius, angle: 0}); } /script /head body onload=init() h2 id=titleOpenLayers Regular Polygon Example/h2 p id=shortdesc Shows how to use the RegularPolygon handler to draw features with different numbers of sides. /p div id=map class=smallmap/div div id=config ul id=controlsbMap Controls/b li input type=radio name=type value=none id=noneToggle onclick=polygonControl.deactivate() checked=checked / label for=noneTogglenavigate/label /li li input type=radio name=type value=polygon id=polygonToggle onclick=polygonControl.activate() / label for=polygonToggledraw polygon/label /li /ul /div /body /html -Nino ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] DrawFeature with callback?
Hi, I presume you have to specify the event name somehow. Try including this: dosomething = function (feature) { } ...callbacks: {'featureAdded': dosomething}... All the best, Adorian On Fri, Dec 5, 2008 at 12:59 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayers ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple callback involved once the polygon are drawn, however the api mentions it's possible. As you can see from the below code the only thing I need for this little thing to work are the function that calls the alert to be picked up. Please say if you want me to elaborate further. html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); polyOptions = {sides: 4, callbacks: {function(value){alert('yeeeha');}} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions }); map.addControl(polygonControl); map.setCenter(new OpenLayers.LonLat(0, 0), 3); document.getElementById('noneToggle').checked = true; document.getElementById('irregularToggle').checked = false; } function setOptions(options) { polygonControl.handler.setOptions(options); } function setSize(fraction) { var radius = fraction * map.getExtent().getHeight(); polygonControl.handler.setOptions({radius: radius, angle: 0}); } /script /head body onload=init() h2 id=titleOpenLayers Regular Polygon Example/h2 p id=shortdesc Shows how to use the RegularPolygon handler to draw features with different numbers of sides. /p div id=map class=smallmap/div div id=config ul id=controlsbMap Controls/b li input type=radio name=type value=none id=noneToggle onclick=polygonControl.deactivate() checked=checked / label for=noneTogglenavigate/label /li li input type=radio name=type value=polygon id=polygonToggle onclick=polygonControl.activate() / label for=polygonToggledraw polygon/label /li /ul /div /body /html -Nino ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Dr. Adorian Ardelean coordinator of myNature Project http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian biodiversity-database] http://mybiosis.info/nature/portal.php?pagename=adorian [CV] ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] DrawFeature with callback?
Okay so I now have this, still not working though: html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); dosomething = function (polygon) { //do something with polygon alert(yeeehaaa); }; polyOptions = {sides: 4, callbacks: {'featureAdded': dosomething} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions }); map.addControl(polygonControl); map.setCenter(new OpenLayers.LonLat(0, 0), 3); document.getElementById('noneToggle').checked = true; } function setOptions(options) { polygonControl.handler.setOptions(options); } function setSize(fraction) { var radius = fraction * map.getExtent().getHeight(); polygonControl.handler.setOptions({radius: radius, angle: 0}); } /script /head body onload=init() h2 id=titleOpenLayers Regular Polygon Example/h2 p id=shortdesc Shows how to use the RegularPolygon handler to draw features with different numbers of sides. /p div id=map class=smallmap/div div id=config ul id=controlsbMap Controls/b li input type=radio name=type value=none id=noneToggle onclick=polygonControl.deactivate() checked=checked / label for=noneTogglenavigate/label /li li input type=radio name=type value=polygon id=polygonToggle onclick=polygonControl.activate() / label for=polygonToggledraw polygon/label /li /ul /div /body /html Adorian Ardelean wrote: Hi, I presume you have to specify the event name somehow. Try including this: dosomething = function (feature) { } ...callbacks: {'featureAdded': dosomething}... All the best, Adorian On Fri, Dec 5, 2008 at 12:59 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayers ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple callback involved once the polygon are drawn, however the api mentions it's possible. As you can see from the below code the only thing I need for this little thing to work are the function that calls the alert to be picked up. Please say if you want me to elaborate further. html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); polyOptions = {sides: 4, callbacks: {function(value){alert('yeeeha');}} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions });
Re: [OpenLayers-Users] DrawFeature with callback?
Hi Nino, This works ok for me: dosomething = function (feature) { //do something with polygon alert(yeeehaaa); }; controls = { polygon: new OpenLayers.Control.DrawFeature(regions,OpenLayers.Handler.Polygon, {'featureAdded': dosomething}) } All the best, Adorian On Fri, Dec 5, 2008 at 2:03 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Okay so I now have this, still not working though: html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); dosomething = function (polygon) { //do something with polygon alert(yeeehaaa); }; polyOptions = {sides: 4, callbacks: {'featureAdded': dosomething} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions }); map.addControl(polygonControl); map.setCenter(new OpenLayers.LonLat(0, 0), 3); document.getElementById('noneToggle').checked = true; } function setOptions(options) { polygonControl.handler.setOptions(options); } function setSize(fraction) { var radius = fraction * map.getExtent().getHeight(); polygonControl.handler.setOptions({radius: radius, angle: 0}); } /script /head body onload=init() h2 id=titleOpenLayers Regular Polygon Example/h2 p id=shortdesc Shows how to use the RegularPolygon handler to draw features with different numbers of sides. /p div id=map class=smallmap/div div id=config ul id=controlsbMap Controls/b li input type=radio name=type value=none id=noneToggle onclick=polygonControl.deactivate() checked=checked / label for=noneTogglenavigate/label /li li input type=radio name=type value=polygon id=polygonToggle onclick=polygonControl.activate() / label for=polygonToggledraw polygon/label /li /ul /div /body /html Adorian Ardelean wrote: Hi, I presume you have to specify the event name somehow. Try including this: dosomething = function (feature) { } ...callbacks: {'featureAdded': dosomething}... All the best, Adorian On Fri, Dec 5, 2008 at 12:59 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayers ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple callback involved once the polygon are drawn, however the api mentions it's possible. As you can see from the below code the only thing I need for this little thing to work are the function that calls the alert to be picked up. Please say if you want me to elaborate further. html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); polyOptions = {sides: 4, callbacks: {function(value){alert('yeeeha');}} }; polygonControl = new
Re: [OpenLayers-Users] Change mouse pointer for Zoombox control
Yes, This happen on all moden browsers. May be we can avoid this problem by apply cursor style on layer container div instead of map div. This should happen automatically. Which OpenLayers version are you using? Which browser? Does it happen as well in the cursor example at: http://dev.openlayers.org/sandbox/bartvde/cursor/openlayers/examples/cursor.html Best regards, Bart Subha Ramakrishnan wrote: Hi , I did try out the changes made in the patch. Now, when i select the zoombox control, the mouse pointer changes to a zoombox cursor. But i am still facing the same problem.Once, i zoom in to an area using the control, the mouse pointer reverts back to the default pointer. Should i explicitly handle that event and set the mouse pointer ? Thanks for the help. Regards, Subha [EMAIL PROTECTED] wrote: Hi, see the patch at: http://trac.openlayers.org/ticket/1484 Best regards, Bart Hi, I have a question regarding mouse pointer for a zoom box control. Is it possible for me to change the mouse pointer to indicate that zoom box control is currently active. I did try setting the cursor using map.style.cursor and it does change when the zoom box control is selected, but when i zoom in to an area, the cursor goes back to the default mouse pointer. Does anyone know how to do is? Or is it available in Openlayers and i am missing it? Thanks for the help. Regards, Subha ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Bart van den Eijnden OSGIS, Open Source GIS [EMAIL PROTECTED] http://www.osgis.nl * -- Li XinGang EMail: [EMAIL PROTECTED] Blog: avlee.cnblogs.com Site:www.mapboost.org.cn ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
[OpenLayers-Users] General question and GML question
Hi everyone, this is about my third time giving OpenLayers a try and this time I thought I would bite the bullet and ask some questions instead of just going back to my mapserver setup. First a general best approach question. What I want to do is use google data and put a simple polygon boundary on top. That boundary is currently in a shape file. My thinking was to convert the shp file to gml and just add it as a layer. I have since read that this maybe tricker then I thought as google data is in a mercator projection that does not have an EPSG code. So then I thought I would just create the projection and project my data to match it in another application before converting it to gml. So my question, is this the best approach, or is there a better way? I could use WMS, but I prefer not to require a wms server to host the local data. Second more specific to the use of GML layers. I converted my shp file to GML using gvSIG and in another attempt shp2gml from spatial order. I cannot get my GML file to be viewable. Thinking it might be a projection issue I thought I would just display my GML file on its own, to avoid any conflicting projections, but that hasnt worked either. Using the gml-layer.html example I tried to work backwards and put my GML file in there, no luck. So my two part question in this regard is: Is there a required element in the GML file that perhaps my GML files are missing? With the gml-layer.html example, if I remove the WMS base layer it will stop displaying the example GML data. Why is that? How can I display GML data by itself for testing purposes? Thanks, Ken -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] General question and GML question
On Fri, Dec 05, 2008 at 11:42:30AM -0400, Ken Sanderson wrote: Hi everyone, this is about my third time giving OpenLayers a try and this time I thought I would bite the bullet and ask some questions instead of just going back to my mapserver setup. First a general best approach question. What I want to do is use google data and put a simple polygon boundary on top. That boundary is currently in a shape file. My thinking was to convert the shp file to gml and just add it as a layer. I have since read that this maybe tricker then I thought as google data is in a mercator projection that does not have an EPSG code. OpenLayers has a built in ability to convert between EPSG:4326 (lat/lon) and Google's Mercator projection: see http://docs.openlayers.org/spherical_mercator/#reprojecting-vector-data for more information on how to use it. Second more specific to the use of GML layers. I converted my shp file to GML using gvSIG and in another attempt shp2gml from spatial order. I cannot get my GML file to be viewable. Thinking it might be a projection issue I thought I would just display my GML file on its own, to avoid any conflicting projections, but that hasnt worked either. Using the gml-layer.html example I tried to work backwards and put my GML file in there, no luck. Can you share the GML file you generated? It's possible this is a version problem, or some other parsing error: without seeing the GML file (or a sample file that fails) it's hard to know for sure. Regards, -- Christopher Schmidt MetaCarta ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
[OpenLayers-Users] Support for GeoRSS polygons in different spatial refs
Hi, Can anyone give me some light on how OpenLayers can handle GeoRSS. I would like to show Polygons in EPSG:2400 without any transformation. The map is also n EPSG:2400. Reading the documentationI I guess it is only Points that could be used by the GeoRSS-layer in OL and no referencesystems could be defined. Is this GeoRSS Simple that the Layer-type GeoRSS can read and render? Is there no support for GeoRSS-gml? When looking into the sample http://www.openlayers.org/dev/examples/vector-formats.html I can see that the GeoRSS layer is used to read GeoRSS -data but it is rendered by a vectorlayer. Is this still geoRSS-simple? If I want to show polygons with GeoRSS OL should I then use the same method as in the example above or is there an other way? If anyone could describe this then I would be very happy. -- mvh Michael -- MetaGIS AB Michael Östling Mob: 070-279 19 76 Tel: 023 - 702 20 10 ePost: [EMAIL PROTECTED] SKYPE: MichaelOstling MSN: [EMAIL PROTECTED] www: http://www.metagis.se Adress: Britsarvsvägen 28a, 791 36 FALUN, Sweden Org Nr: 556638-7170 -- ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] WFS popup alignment
Hi Andrew, I did eventually figure out that it was the spherical mercator problem, again, though I was/am confused as to why the popup would be placed correctly yet the feature it was derived from was not! Unfortuntely, it's not always possible to get enough access to alter the epsg file and add 900913 support for mapserver. For example, you may have access to only the web folders on a server (from personal experience). In those cases, you have to find a different solution to the problem, although of course you can use different background imagery and eschew the commercial layers... Thanks again Jo - Joanne Cook Senior IT Support and Development Oxford Archaeology (North) 01524 880212 http://thehumanjourney.net - Original Message - From: Andrew Parker [EMAIL PROTECTED] To: users@openlayers.org Sent: Thursday, 4 December, 2008 15:32:08 GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [OpenLayers-Users] WFS popup alignment Hello Joanne: I am headed out of the office but wanted to give you something to considerhave you read: http://docs.openlayers.org/spherical_mercator/ which discusses projection issues using google, yahoo, ve, etc with user created layers. Also, I am working on projection issues as well. I started a post which discusses projection issues which may help you with yours. If you go to my layer intialization script ( http://webmap.rthicksconsult.com/c2corgCreateMap_projection.js ) you will see how I had to add {'shericalMercator':true}. As an example gsatellite = new OpenLayers.Layer.Google(Google Satellite, {type:G_HYBRID_MAP, 'sphericalMercator': true, buffer:0} ); map.addLayer (gsatellite); My thread is at http://www.nabble.com/Cannot-display-search-marker-when-projecting-layers-to-EPSG-900913-td20771840.html#a20771840 . Hope this will give some insight to your issue. Andrew Parker Joanne Cook wrote: Hi List, I have both WMS and WFS layers from a postgres table (starting with WMS but moving to WFS as you zoom in), on top of Microsoft Virtua Earth. You click the WFS points and get a framedcloud popup of the feature attribute data. This aspect works fine, but there is an issue with the alignment of the WFS points. There are some zoom levels where I can see that the WFS layer does not align correctly with the WMS, this is worse at the bottom of the map square and better towards the top. Not only that, the anchor for the popup aligns correctly with the WMS rather than the WFS. So you click on a point and the popup appears next to the correct location rather than where you have clicked. I assume this is something to do with projections, but I'm a little stuck and would appreciate some assistance. I can't show the map itself because it isn't available to the outside world, but the salient bits of the code are here: var map, ve, wms, wfs, drawControls, selectControl, selectedFeature; function onPopupClose(evt) { selectControl.unselect(selectedFeature); } function onFeatureSelect(feature) { selectedFeature = feature; var projcode = selectedFeature.attributes['projcode']; var sitecode = selectedFeature.attributes['sitecode']; var projnam = selectedFeature.attributes['projnam']; var year = selectedFeature.attributes['year']; popup = new OpenLayers.Popup.FramedCloud(info, feature.geometry.getBounds().getCenterLonLat(), null, div style='font-size:.8em'Project Code: + projcode +br /Site Code: + sitecode+br /Project Name: + projnam + br /Year: + year + /div, null, true, onPopupClose); feature.popup = popup; map.addPopup(popup); } function onFeatureUnselect(feature) { map.removePopup(feature.popup); feature.popup.destroy(); feature.popup = null; } function init(){ map = new OpenLayers.Map('map'); ve = new OpenLayers.Layer.VirtualEarth( Virtual Earth,{'type': VEMapStyle.Hybrid}); wms = new OpenLayers.Layer.WMS(OA Sites WMS, http://10.0.10.106/cgi-bin/mapservpostgis.cgi?; , {layers: 'oasites', transparent: true, format: 'image/png', buffer:0}, {isBaseLayer: false, reproject: true}, {scales: [1400,50]}); wfs = new OpenLayers.Layer.WFS(OA Sites WFS, http://10.0.10.106/cgi-bin/mapservpostgis.cgi?; , {typename: 'oasites', maxfeatures: 200, featureNS: ' http://mapserver.gis.umn.edu/mapserver ', typename: 'ms:oasites'}, {scales: [50, 10], extractAttributes: true},
Re: [OpenLayers-Users] DrawFeature with callback?
There seems to be only cancel and done as callbacks for OpenLayers.Handler.RegularPolygon, but how to use them I don't have a clue. The done callback is declared in OpenLayers.Control.DrawFeature to draw the feature, trigger featureadded and call a empty function featureAdded. This function you can declare to do something after the feature is added to the layer. polygonControl.featureAdded = function() { dosomething();}; or (not tested) you can register the event featureadded to the control. Arnd Wippermann -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Nino Saturnino Martinez Vazquez Wael Gesendet: Freitag, 5. Dezember 2008 14:03 An: Adorian Ardelean Cc: users@openlayers.org Betreff: Re: [OpenLayers-Users] DrawFeature with callback? Okay so I now have this, still not working though: html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( OpenLayers WMS, http://labs.metacarta.com/wms/vmap0?;, {layers: 'basic'}); var polygonLayer = new OpenLayers.Layer.Vector(Polygon Layer); map.addLayers([wmsLayer, polygonLayer]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); dosomething = function (polygon) { //do something with polygon alert(yeeehaaa); }; polyOptions = {sides: 4, callbacks: {'featureAdded': dosomething} }; polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer, OpenLayers.Handler.RegularPolygon, {handlerOptions: polyOptions }); map.addControl(polygonControl); map.setCenter(new OpenLayers.LonLat(0, 0), 3); document.getElementById('noneToggle').checked = true; } function setOptions(options) { polygonControl.handler.setOptions(options); } function setSize(fraction) { var radius = fraction * map.getExtent().getHeight(); polygonControl.handler.setOptions({radius: radius, angle: 0}); } /script /head body onload=init() h2 id=titleOpenLayers Regular Polygon Example/h2 p id=shortdesc Shows how to use the RegularPolygon handler to draw features with different numbers of sides. /p div id=map class=smallmap/div div id=config ul id=controlsbMap Controls/b li input type=radio name=type value=none id=noneToggle onclick=polygonControl.deactivate() checked=checked / label for=noneTogglenavigate/label /li li input type=radio name=type value=polygon id=polygonToggle onclick=polygonControl.activate() / label for=polygonToggledraw polygon/label /li /ul /div /body /html Adorian Ardelean wrote: Hi, I presume you have to specify the event name somehow. Try including this: dosomething = function (feature) { } ...callbacks: {'featureAdded': dosomething}... All the best, Adorian On Fri, Dec 5, 2008 at 12:59 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayer s ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple callback involved once the polygon are drawn, however the api mentions it's possible. As you can see from the below code the only thing I need for this little thing to work are the function that calls the alert to be picked up. Please say if you want me to elaborate further. html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl; OpenLayers.Util.onImageLoadErrorColor = transparent; function init(){ map = new OpenLayers.Map('map'); var
Re: [OpenLayers-Users] WFS popup alignment
If you use OpenLayers.Layer.MapServer you can use the parameter map_projection to change the projection on the fly. http://www.mail-archive.com/[EMAIL PROTECTED]/msg12820.html Arnd Wippermann -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Joanne Cook Gesendet: Freitag, 5. Dezember 2008 18:23 An: Andrew Parker Cc: users@openlayers.org Betreff: Re: [OpenLayers-Users] WFS popup alignment Hi Andrew, I did eventually figure out that it was the spherical mercator problem, again, though I was/am confused as to why the popup would be placed correctly yet the feature it was derived from was not! Unfortuntely, it's not always possible to get enough access to alter the epsg file and add 900913 support for mapserver. For example, you may have access to only the web folders on a server (from personal experience). In those cases, you have to find a different solution to the problem, although of course you can use different background imagery and eschew the commercial layers... Thanks again Jo - Joanne Cook Senior IT Support and Development Oxford Archaeology (North) 01524 880212 http://thehumanjourney.net - Original Message - From: Andrew Parker [EMAIL PROTECTED] To: users@openlayers.org Sent: Thursday, 4 December, 2008 15:32:08 GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [OpenLayers-Users] WFS popup alignment Hello Joanne: I am headed out of the office but wanted to give you something to considerhave you read: http://docs.openlayers.org/spherical_mercator/ which discusses projection issues using google, yahoo, ve, etc with user created layers. Also, I am working on projection issues as well. I started a post which discusses projection issues which may help you with yours. If you go to my layer intialization script ( http://webmap.rthicksconsult.com/c2corgCreateMap_projection.js ) you will see how I had to add {'shericalMercator':true}. As an example gsatellite = new OpenLayers.Layer.Google(Google Satellite, {type:G_HYBRID_MAP, 'sphericalMercator': true, buffer:0} ); map.addLayer (gsatellite); My thread is at http://www.nabble.com/Cannot-display-search-marker-when-projecting-layers-to -EPSG-900913-td20771840.html#a20771840 . Hope this will give some insight to your issue. Andrew Parker Joanne Cook wrote: Hi List, I have both WMS and WFS layers from a postgres table (starting with WMS but moving to WFS as you zoom in), on top of Microsoft Virtua Earth. You click the WFS points and get a framedcloud popup of the feature attribute data. This aspect works fine, but there is an issue with the alignment of the WFS points. There are some zoom levels where I can see that the WFS layer does not align correctly with the WMS, this is worse at the bottom of the map square and better towards the top. Not only that, the anchor for the popup aligns correctly with the WMS rather than the WFS. So you click on a point and the popup appears next to the correct location rather than where you have clicked. I assume this is something to do with projections, but I'm a little stuck and would appreciate some assistance. I can't show the map itself because it isn't available to the outside world, but the salient bits of the code are here: var map, ve, wms, wfs, drawControls, selectControl, selectedFeature; function onPopupClose(evt) { selectControl.unselect(selectedFeature); } function onFeatureSelect(feature) { selectedFeature = feature; var projcode = selectedFeature.attributes['projcode']; var sitecode = selectedFeature.attributes['sitecode']; var projnam = selectedFeature.attributes['projnam']; var year = selectedFeature.attributes['year']; popup = new OpenLayers.Popup.FramedCloud(info, feature.geometry.getBounds().getCenterLonLat(), null, div style='font-size:.8em'Project Code: + projcode +br /Site Code: + sitecode+br /Project Name: + projnam + br /Year: + year + /div, null, true, onPopupClose); feature.popup = popup; map.addPopup(popup); } function onFeatureUnselect(feature) { map.removePopup(feature.popup); feature.popup.destroy(); feature.popup = null; } function init(){ map = new OpenLayers.Map('map'); ve = new OpenLayers.Layer.VirtualEarth( Virtual Earth,{'type': VEMapStyle.Hybrid}); wms = new OpenLayers.Layer.WMS(OA Sites WMS, http://10.0.10.106/cgi-bin/mapservpostgis.cgi?; , {layers: 'oasites', transparent: true, format: 'image/png', buffer:0}, {isBaseLayer: false, reproject: true},
Re: [OpenLayers-Users] Querying multiple layers
Alexandre, Thanks! That worked great. [EMAIL PROTECTED] wrote: I have a map with multiple layers (view at http://ecotropolis.com/maps/NorthAmericaWatershed.html) and I want to be able to click on a feature of any of the maps and retrieve data from the WMS (I'm using Geoserver). I initially got it working using the following line in getFullRequestString: QUERY_LAYERS: map.layers[1].params.LAYERS, This works with one map. I tried extending it to two layers: QUERY_LAYERS: map.layers[1].params.LAYERS, map.layers[2].params.LAYERS, Have you tried something like this : If you use Layer.WMS : QUERY_LAYERS: map.layers[1].params.LAYERS + , + map.layers[2].params.LAYERS, If you use Layer.MapServer: QUERY_LAYERS: map.layers[1].params.LAYERS + + map.layers[2].params.LAYERS, Alexandre but that gave me an error. I got it to run using the following: QUERY_LAYERS: wms.params.LAYERS, Which gives me data, but it is generic for the entire layer to which the selected feature belongs instead of specific to a particular element. How can I set this up to query multiple layers and return information specific to the selected feature? Regards, Amy ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Alexandre Dubé Mapgears www.mapgears.com ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] Using OpenLayers for interactive plotting
On Fri, Dec 05, 2008 at 03:58:42PM -0800, Bobby Moretti wrote: Hi, I'm interested in making an interactive, web-based viewer for mathematical plots with Google maps-style dragging and zooming. I stumbled across OpenLayers, and it seems like it might be a good tool to use for this. I've looked through some of the documentation, but I'm having trouble figuring out how to go about setting up a custom data source. http://trac.openlayers.org/wiki/UsingCustomTiles Might help. Is this even feasible? Is OpenLayers the right framework for such a viewer, or should I be looking for something else? Thanks for any input, -Bobby -- Bobby Moretti [EMAIL PROTECTED] ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Christopher Schmidt MetaCarta ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] wfs-t modify problem
Hi Andreas, I found the solution to the issue by applying http://trac.openlayers.org/ticket/1787 Improper tynenames was the issue. Regards, Indika 2008/12/4 Andreas Hocevar [EMAIL PROTECTED] Hi, On Thu, Nov 20, 2008 at 7:06 PM, Indika Tantrigoda [EMAIL PROTECTED] wrote: Hello to all, In my wfs-t modification request the tag is as follows wfs:Update typeName =features which I am guessing is causing a problem. Should typeName = features:cities or typeName=topp:cities be present here instead ? You should provide the relevant snippets of your javascript code. Without knowing what you have done, it is hard to tell you what might be wrong. 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