Re: [OpenLayers-Users] How to print map area with openlayers

2010-04-15 Thread soatley


rakesh.modi1585 wrote:
 
 Hi,
 
 I want to print map area (WMS Layer) with overlay vector layers. Is it
 possible in openlayers, if it then how it is done?
 
 Thanks 
 Rakesh
 

Check out the link that Lisa said in her e-mail.  We resorted to a server
side stitching because we couldn't rely on the differences between browsers. 
Some browsers wouldn't be able to print all the layers and we didn't have
much success with printing vector.  

By going server side, we can control all that (including vectors) and
provide options for output (JPG, PDF, etc..)

Shawn
-- 
View this message in context: 
http://n2.nabble.com/How-to-print-map-area-with-openlayers-tp4901023p4907889.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] New OpenLayers Site

2010-01-05 Thread soatley

Hi everyone,

Here's an example of our soon-to-be-released IMS which uses OpenLayers and
TileCache:

http://tomas.fallsviewer.ca http://tomas.fallsviewer.ca 

We are using Manifold in the back end to generate most of the tiles (and
cached by TileCache) along with handle the Spatial/Information requests.

There are still a few issues we need to work out (ortho layer transparency,
and some minor printing issues) but it should be released within the next
couple of months if all goes well.

It is already used throughout our main site for what we call the
'mini-maps':

http://www.niagarafalls.ca/business/business_directory/single.asp?listID=49229
http://www.niagarafalls.ca/business/business_directory/single.asp?listID=49229 

If you decide to give it a go, please let me know if you run into any odd
things or have any questions.  We are still ironing out some bugs.

Thanks,
Shawn
-- 
View this message in context: 
http://n2.nabble.com/New-OpenLayers-Site-tp4257614p4257614.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] ModifyFeatureControl - vertices styling

2009-12-16 Thread soatley

I just went through this myself.

In my case, I was already taking advantage of using vector styling context
(similar to this example: 
http://www.openlayers.org/dev/examples/styles-context.html
http://www.openlayers.org/dev/examples/styles-context.html )

I found that the points that are used for the vertices have a property
called _sketch.  This allowed me to pick out those particular points and
style them accordingly.  

This solution may be overkill for what you are looking for though

 /* styling for the vector layers */

/* different styles to apply depending on the type of vector */
vectorTypeLookup[normal] = { fillColor: '#ee9900', fillOpacity:
0.4, strokeWidth: 1.0, strokeColor: '#ee9900', pointRadius: 6 };
vectorTypeLookup[polygon] = { fillColor: '#ee9900', fillOpacity:
0.4, strokeWidth: 1.0, strokeColor: '#ee9900', pointRadius: 6 };
vectorTypeLookup[point] = { fillColor: '#ee9900', fillOpacity:
0.4, strokeWidth: 2.0, strokeColor: '#ee9900', pointRadius: 8 };
vectorTypeLookup[line] = { fillColor: '#ee9900', fillOpacity: 0.4,
strokeWidth: 3.0, strokeColor: '#ee9900', pointRadius: 6 };
vectorTypeLookup[label] = { fillColor: '#ee9900', fillOpacity:
0.4, strokeWidth: 1.0, strokeColor: '#ee9900', pointRadius: 3,
labelAlign: tr, fontSize: 12px, fontColor: #005596,
fontWeight: bold, labelSelect: true
};
vectorTypeLookup[sketch] = { fillColor: '#005596', fillOpacity:
0.4, strokeWidth: 3.0, strokeColor: '#005596', pointRadius: 6 };

/* create a template that will use the functions to get the
appropriate colour */
var vectorTemplate = { fillColor: ${getFillColour}, fillOpacity:
${getFillOpacity}, strokeWidth: ${getStrokeWidth}, strokeColor:
${getStrokeColour}, pointRadius: ${getPointRadius},
labelAlign: ${getLabelAlign}, fontSize: ${getFontSize},
fontColor: ${getFontColour}, fontWeight: ${getFontWeight}, labelSelect:
${getLabelSelect}, label: ${getLabel}
};

/* 
the style will use the context when determining the appropriate
style - see the vectorStyle declaration
- ex.  drawing a polygon on the drawLayer.
1) drawLayer is assigned the vectorStyleMap to detrmine the style
2) The vectorStyleMap uses the vectorStyle rule to know what style
properties are available
3) The vectorStyle refers to vectorTemplate to configure the
different properties (fillColor, strokeWidth).  The vectorContext is used to
evaluate the ${...} items
4) Each function in vectorContext returns the appropriate property
value

*/
var vectorContext = {
getVectorType: function(feature) {
try {
if (typeof (feature._sketch) !== undefined) {
return vectorTypeLookup[sketch]; /* used when
modifying items */
} else if
(feature.geometry.CLASS_NAME.search(/polygon$/i) = 0) {
return vectorTypeLookup[polygon];
} else if (feature.geometry.CLASS_NAME.search(/point$/i)
= 0  typeof (feature.attributes.label) !== undefined) { /* labels are
point vectors */
return vectorTypeLookup[label];
} else if (feature.geometry.CLASS_NAME.search(/point$/i)
= 0) {
return vectorTypeLookup[point];
} else if
(feature.geometry.CLASS_NAME.search(/linestring$/i) = 0) {
return vectorTypeLookup[line];
} else {
/*who knows */
return vectorTypeLookup[normal];
}
} catch (e) { return vectorTypeLookup[normal]; }
},
getFillColour: function(feature) { return
vectorContext.getVectorType(feature).fillColor; },
getFillOpacity: function(feature) { return
vectorContext.getVectorType(feature).fillOpacity; },
getStrokeWidth: function(feature) { return
vectorContext.getVectorType(feature).strokeWidth; },
getStrokeColour: function(feature) { return
vectorContext.getVectorType(feature).strokeColor; },
getPointRadius: function(feature) { return
vectorContext.getVectorType(feature).pointRadius; },
getLabel: function(feature) {
if (typeof (feature.attributes.label) != undefined) {
/* return the label */
return feature.attributes.label;
} else {
return ; /* nothing */
}
},
getLabelAlign: function(feature) {
try {
return vectorContext.getVectorType(feature).labelAlign;
} catch (e) { return ; }
},
getFontSize: function(feature) {
try {
return vectorContext.getVectorType(feature).fontSize;
} catch (e) { return ; }
  

[OpenLayers-Users] Draw Features by entering size (radius / length)

2009-10-23 Thread soatley

How can I use the DrawFeatures tool(s) to draw features by specifying a size. 
For example, create a circle with a radius of 100 metres?  Draw a line 50
metres long?

Even if the user has to draw a basic object (circle for example) and then
once it is created, specify the radius.

Thanks!
Shawn
-- 
View this message in context: 
http://n2.nabble.com/Draw-Features-by-entering-size-radius-length-tp3879669p3879669.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] OL on Blackerry?

2009-07-30 Thread soatley

Has anyone had any experience working on developing an OL site that works
with Blackberry devices?  

Shawn
-- 
View this message in context: 
http://n2.nabble.com/OL-on-Blackerry--tp3357079p3357079.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] Error displaying map in IE8 - VML.js

2009-07-29 Thread soatley

In case anyone else runs into this, I found out that after the map is
created, it sometimes doesn't set a height or width value in the map.size
property.  Here's my fix which seems to work quite nicely:

 map = new OpenLayers.Map('map', options);
if (isNaN(map.size.w) || isNaN(map.size.h)) {
map.updateSize();
}


Shawn

soatley wrote:
 
 
 I have a feeling I am running into the same issue here.  I am using
 Revision 9492 and the problem I encounter is the Invalid Argument error
 when adding vector layers to the map.
 
 I have tried it on IE 7 (Win XP 32 bit) and IE 8 (Vista 64, in
 compatability mode).  IE 8 on Vista not in compat. mode works fine.
 
 It seems to be very similar to the issue with Ticket 1910 from what I can
 tell  Setting up an IE breakpoint on line 600 of OpenLayers.js it
 breaks where the variables w and h are assigned because this.size.w is
 NaN.  If you were to look at the VML.js file, it is in the area of line
 154.
 
 Does anyone have any new information or a way I can work around this?
 
 Shawn
 
 
 Christopher Schmidt-2 wrote:
 
 On Thu, Jun 18, 2009 at 10:23:15AM -0700, palewire wrote:
 
 I've encountered some IE8 errors too. Here's the paste from what the
 browser
 gives you. Is there anything I can do to help out?
 
 What SVN version is this with? This should only have been fixed in the
 last few commits.
 
 -- Chris
 
 
 Webpage error details
 
 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0)
 Timestamp: Thu, 18 Jun 2009 17:21:04 UTC
 
 
 Message: Invalid argument.
 Line: 793
 Char: 110
 Code: 0
 URI: http:// ... /openlayers/OpenLayers.js
 
 
 
 
 Asle Benoni wrote:
  
  Sorry Christopher and others. That was a bad one from me. I did't like  
  my attitude there.
  Of course I will test it since I had the problem just now. Glad you  
  pointed that out since I am always so glad and amazed at people here  
  just helping out ;-)
  Hope I can contribute also.
  
  /asle
  
  
  Den 12. juni. 2009 kl. 16.01 skrev Christopher Schmidt:
  
  On Fri, Jun 12, 2009 at 03:52:54PM +0200, Asle Benoni wrote:
  Thanks Kenneth, the compatibility hack works fine. I would rather  
  not hack
  VML.js but I see this hack is newer than the one I tried. As long  
  as the
  quickfix works I am satisfied. But would like to know if some have  
  success
  with it and if it is included in future OL release.
 
  It can't be included in a future OL release until people test it. If
  you're unwilling to test it, the chances it will be included
 decrease.
  Please help test it if you care about it.
 
  -- Chris
 
  /asle
 
  2009/6/12 Andreas Hocevar ahoce...@opengeo.org
 
  Hi,
 
  On Fri, Jun 12, 2009 at 8:53 AM, Kenneth Skovhede, GEOGRAF
  A/Sk...@geograf.dk wrote:
  Note sure what the actual problem is, but there are notes that  
  the patch
  does not solve all issues.
 
  There is a nother fix mentioned, namely the one in comment #20:
  http://trac.openlayers.org/ticket/1910#comment:20
 
  This effectively places IE8 in IE7 compatibility mode, and it  
  works.
  Although it's not the correct long term solution, you can use it  
  until
  the issue is fixed more permanently.
 
  The latest patch [1] should fix all vector layer issues in IE8. It
  would be nice to get some feedback if this is really the case.
 
  Regards,
  Andreas.
 
  [1]
 
 http://trac.openlayers.org/attachment/ticket/1910/openlayers-1910.patch
 
  --
  Andreas Hocevar
  OpenGeo - http://opengeo.org/
  Expert service straight from the developers.
 
 
  ___
  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
  
  
 
 -- 
 View this message in context:
 http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3114656.html
 Sent from the OpenLayers Users mailing list archive at Nabble.com.
 
 ___
 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
 
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3350599.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] Error displaying map in IE8 - VML.js

2009-07-29 Thread soatley

Should have checked my CSS before posting that mesage.  

Here is what I already have defined in for my map object:
#map
{
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}



Andreas Hocevar-2 wrote:
 
 soatley wrote:
 In case anyone else runs into this, I found out that after the map is
 created, it sometimes doesn't set a height or width value in the map.size
 property.  Here's my fix which seems to work quite nicely:

  map = new OpenLayers.Map('map', options);
 if (isNaN(map.size.w) || isNaN(map.size.h)) {
 map.updateSize();
 }
   
 
 You can also make sure that the container where you render the map in
 (in your snippet a div or whatever element with id 'map') has a width
 and height style before you create the map object.
 
 Regards,
 Andreas.
 
 

 Shawn

 soatley wrote:
   
 I have a feeling I am running into the same issue here.  I am using
 Revision 9492 and the problem I encounter is the Invalid Argument error
 when adding vector layers to the map.

 I have tried it on IE 7 (Win XP 32 bit) and IE 8 (Vista 64, in
 compatability mode).  IE 8 on Vista not in compat. mode works fine.

 It seems to be very similar to the issue with Ticket 1910 from what I
 can
 tell  Setting up an IE breakpoint on line 600 of OpenLayers.js it
 breaks where the variables w and h are assigned because this.size.w is
 NaN.  If you were to look at the VML.js file, it is in the area of line
 154.

 Does anyone have any new information or a way I can work around this?

 Shawn


 Christopher Schmidt-2 wrote:
 
 On Thu, Jun 18, 2009 at 10:23:15AM -0700, palewire wrote:
   
 I've encountered some IE8 errors too. Here's the paste from what the
 browser
 gives you. Is there anything I can do to help out?
 
 What SVN version is this with? This should only have been fixed in the
 last few commits.

 -- Chris

   
 Webpage error details

 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0)
 Timestamp: Thu, 18 Jun 2009 17:21:04 UTC


 Message: Invalid argument.
 Line: 793
 Char: 110
 Code: 0
 URI: http:// ... /openlayers/OpenLayers.js




 Asle Benoni wrote:
 
 Sorry Christopher and others. That was a bad one from me. I did't
 like  
 my attitude there.
 Of course I will test it since I had the problem just now. Glad you  
 pointed that out since I am always so glad and amazed at people here  
 just helping out ;-)
 Hope I can contribute also.

 /asle


 Den 12. juni. 2009 kl. 16.01 skrev Christopher Schmidt:

   
 On Fri, Jun 12, 2009 at 03:52:54PM +0200, Asle Benoni wrote:
 
 Thanks Kenneth, the compatibility hack works fine. I would rather  
 not hack
 VML.js but I see this hack is newer than the one I tried. As long  
 as the
 quickfix works I am satisfied. But would like to know if some have  
 success
 with it and if it is included in future OL release.
   
 It can't be included in a future OL release until people test it. If
 you're unwilling to test it, the chances it will be included
 
 decrease.
 
 Please help test it if you care about it.

 -- Chris

 
 /asle

 2009/6/12 Andreas Hocevar ahoce...@opengeo.org

   
 Hi,

 On Fri, Jun 12, 2009 at 8:53 AM, Kenneth Skovhede, GEOGRAF
 A/Sk...@geograf.dk wrote:
 
 Note sure what the actual problem is, but there are notes that  
 the patch
 does not solve all issues.

 There is a nother fix mentioned, namely the one in comment #20:
 http://trac.openlayers.org/ticket/1910#comment:20

 This effectively places IE8 in IE7 compatibility mode, and it  
 works.
 Although it's not the correct long term solution, you can use it  
 until
 the issue is fixed more permanently.
   
 The latest patch [1] should fix all vector layer issues in IE8. It
 would be nice to get some feedback if this is really the case.

 Regards,
 Andreas.

 [1]

 
 http://trac.openlayers.org/attachment/ticket/1910/openlayers-1910.patch
 
 --
 Andreas Hocevar
 OpenGeo - http://opengeo.org/
 Expert service straight from the developers.

 
 ___
 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


   
 -- 
 View this message in context:
 http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3114656.html
 Sent from the OpenLayers Users mailing list archive at Nabble.com.

 ___
 Users mailing list
 Users@openlayers.org
 http://openlayers.org/mailman/listinfo/users
 
 -- 
 Christopher Schmidt
 MetaCarta
 ___
 Users mailing list
 Users

Re: [OpenLayers-Users] transitionEffect bug?

2009-07-29 Thread soatley

I tried some very basic tests with and without the resize option and it does
seem to create a fair number of additional requests.

Here are my results...
With Resize:
Initial Load: 585 requests
+1 Zoom level: 999 requests (+414 for the zoom)
-1 Zoom level: 1096requests (+97 for the zoom)

Without Resize:
Initial Load: 419 requests
+1 Zoom level: 683 requests (+192 for the zoom)
-1 Zoom level: 731 requests (+48 for the zoom)

The site I am testing with has about 5 WMS layers, a couple of vector layers
(shouldn't matter) and about 15 tool buttons on the screen (plus the zoom
bar, pan bar).  On the initial load, there are 3 layers turned on.  (If this
info helps.)

For now, I will keep the resize effect turned off because it does seem to
make a decent speed difference.

Shawn


Paul Spencer wrote:
 
 When using the resize option, two images are created for each tile.   
 The 'current' image is resized when zooming and the new image is  
 loaded in front of it, effectively providing greater (or lesser)  
 detail.  I don't think it should be making any additional requests for  
 a zoom. Could be a bug, or possibly a side effect of using (firebug?)  
 to monitor the requests and not having caching turned on in your  
 browser?
 
 Paul
 
 On 29-Jul-09, at 6:27 AM, Andrea Di Nora wrote:
 
 Hi, I have a question on transitionEffect with option 'resize', when  
 i use this effect on a TMS Layer, every time i make a zoom, two  
 request for each single tile have been launched. It is correct or a  
 bug? You can test with tms.html example adding transitionEffect:  
 'resize', on TMS Layer Options.

 Thank you for response.

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

-- 
View this message in context: 
http://n2.nabble.com/transitionEffect-bug--tp3348923p3351576.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] Error displaying map in IE8 - VML.js

2009-07-27 Thread soatley


I have a feeling I am running into the same issue here.  I am using Revision
9492 and the problem I encounter is the Invalid Argument error when adding
vector layers to the map.

I have tried it on IE 7 (Win XP 32 bit) and IE 8 (Vista 64, in compatability
mode).  IE 8 on Vista not in compat. mode works fine.

It seems to be very similar to the issue with Ticket 1910 from what I can
tell  Setting up an IE breakpoint on line 600 of OpenLayers.js it breaks
where the variables w and h are assigned because this.size.w is NaN.  If you
were to look at the VML.js file, it is in the area of line 154.

Does anyone have any new information or a way I can work around this?

Shawn


Christopher Schmidt-2 wrote:
 
 On Thu, Jun 18, 2009 at 10:23:15AM -0700, palewire wrote:
 
 I've encountered some IE8 errors too. Here's the paste from what the
 browser
 gives you. Is there anything I can do to help out?
 
 What SVN version is this with? This should only have been fixed in the
 last few commits.
 
 -- Chris
 
 
 Webpage error details
 
 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0)
 Timestamp: Thu, 18 Jun 2009 17:21:04 UTC
 
 
 Message: Invalid argument.
 Line: 793
 Char: 110
 Code: 0
 URI: http:// ... /openlayers/OpenLayers.js
 
 
 
 
 Asle Benoni wrote:
  
  Sorry Christopher and others. That was a bad one from me. I did't like  
  my attitude there.
  Of course I will test it since I had the problem just now. Glad you  
  pointed that out since I am always so glad and amazed at people here  
  just helping out ;-)
  Hope I can contribute also.
  
  /asle
  
  
  Den 12. juni. 2009 kl. 16.01 skrev Christopher Schmidt:
  
  On Fri, Jun 12, 2009 at 03:52:54PM +0200, Asle Benoni wrote:
  Thanks Kenneth, the compatibility hack works fine. I would rather  
  not hack
  VML.js but I see this hack is newer than the one I tried. As long  
  as the
  quickfix works I am satisfied. But would like to know if some have  
  success
  with it and if it is included in future OL release.
 
  It can't be included in a future OL release until people test it. If
  you're unwilling to test it, the chances it will be included decrease.
  Please help test it if you care about it.
 
  -- Chris
 
  /asle
 
  2009/6/12 Andreas Hocevar ahoce...@opengeo.org
 
  Hi,
 
  On Fri, Jun 12, 2009 at 8:53 AM, Kenneth Skovhede, GEOGRAF
  A/Sk...@geograf.dk wrote:
  Note sure what the actual problem is, but there are notes that  
  the patch
  does not solve all issues.
 
  There is a nother fix mentioned, namely the one in comment #20:
  http://trac.openlayers.org/ticket/1910#comment:20
 
  This effectively places IE8 in IE7 compatibility mode, and it  
  works.
  Although it's not the correct long term solution, you can use it  
  until
  the issue is fixed more permanently.
 
  The latest patch [1] should fix all vector layer issues in IE8. It
  would be nice to get some feedback if this is really the case.
 
  Regards,
  Andreas.
 
  [1]
 
 http://trac.openlayers.org/attachment/ticket/1910/openlayers-1910.patch
 
  --
  Andreas Hocevar
  OpenGeo - http://opengeo.org/
  Expert service straight from the developers.
 
 
  ___
  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
  
  
 
 -- 
 View this message in context:
 http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3114656.html
 Sent from the OpenLayers Users mailing list archive at Nabble.com.
 
 ___
 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
 
 

-- 
View this message in context: 
http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3336661.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] Call function before control activate

2009-07-09 Thread soatley

I can't seem to find a way to call a function before a control is activated. 
What I am trying to do is record the currently active control before
activating the new control.  That way, when the control is done executing,
the previous control can be re-activated.  

This would be useful for tools that perform a function on click and then
they are done (for example, clear all selections on a layer).

I have tried checking what control is active when the new control.activate
is fired, but by that time, the old control seems to have been decativated
because it's active property is set to false.  By extending a control (see
code below) it executes when the control is created, but not activated.


clearSelectionControl = new OpenLayers.Control({ title: Clear any
selections, displayClass: olControlClearSelection });
OpenLayers.Util.extend(clearSelectionControl, {
draw: function() {
this.box = new OpenLayers.Handler.Box(clearSelectionControl,
{ done: this.notice,
activate: this.makeActive
});
log(checking active control);
for (var c in map.controls) {
if (map.controls[c].active == true) {
log(map.controls[c].displayClass + :  +
map.controls[c].active);
}
}
log(done checking);
},

notice: function(bounds) {
log(firing notice);
}
});

Can anyone think of a way to do this?


Shawn
-- 
View this message in context: 
http://n2.nabble.com/Call-function-before-control-activate-tp3233944p3233944.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] Can't get OpenLayers to Co-operate with TileCache resolutions

2009-07-02 Thread soatley

Hopefully someone can see what I must be doing wrong  

I have been trying to get TileCache (most recent from site) to work nicely
with OL 2.8 for a week and it just doesn't seem to be working perfectly.

Here is my map config:

 options = {
projection: new OpenLayers.Projection(EPSG:26917),
/*maxExtent: new OpenLayers.Bounds(640541.774843334,
4755587.40501464, 667085.402317306, 4779623.23729788),*/
maxExtent: new OpenLayers.Bounds(640541.77, 4755587.40, 667085.40,
4779623.23),
units: m,
tileSize: new OpenLayers.Size(256, 256),
/*resolutions: [850, 425, 212.5, 106.25, 53.125, 26.5625, 13.28125,
6.640625, 3.3203125, 1.66015625, 0.830078125, 0.4150390625, 0.20751953125,
0.103759765625, 0.0518798828125],*/
resolutions: [850, 425, 212.5, 106.25, 53.12, 26.56, 13.28, 6.64,
3.32, 1.66, 0.83, 0.41, 0.20, 0.10, 0.05],

/*numZoomLevels: 15,*/

controls: [new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.MousePosition({ div:
$j(#position).get(0) }),
new OpenLayers.Control.LoadingPanel(),
new OpenLayers.Control.ScaleBar()
]
};



You can see I've tried different map resolutions and bounding boxes because
I read some threads that indicated we should not have a large number of
decimal places. 

My tilecache.cfg:


[basewdrawing]
type=WMS
url=http://wmsServer
layers=wmsLayers
extension=png
mime_type=image/png
#resolutions=850,425,212.5,106.25,53.125,26.5625,13.28125,6.640625,3.3203125,1.66015625,0.830078125,0.4150390625,0.20751953125,0.103759765625,0.0518798828125
resolutions=850,425,212.5,106.25,53.12,26.56,13.28,6.64,3.32,1.66,0.83,0.41,0.20,0.10,0.05
bbox=640541.77, 4755587.40, 667085.40, 4779623.23
#bbox=640541.774843334, 4755587.40501464, 667085.402317306, 4779623.23729788
metaTile=true
metaSize=11,11
srs=EPSG:26917
extent_type=loose


I've tried with extent_type and without - that didn't seem to have any
difference.

When I seed my cache with tilecache_seed.py I don't get any error messages
and it appears to work properly.  Files are created, they aren't blank, etc.

I have tried using Layer.TileCache  and Layer.WMS.  With the TileCache
layers, I get misplaced tiles and with the WMS layer I get a resolution
error:

An error occurred: can't find resolution index for 2.00. Available
resolutions are: 
[850.0, 425.0, 212.5, 106.25, 53.117, 26.559,
13.279, 6.6397, 3.3198,
1.6599, 0.82996, 0.40998,
0.20001, 0.10001, 0.050003]


I don't understand why I get this error because both the TC and OL config's
have the resolutions specified.

Finally, my layer config:

var BaseMap = new OpenLayers.Layer.WMS(Base Map,

[http://wmsServer/tilecache.py,http://wmsServer/tilecache.py;],
{ 
 layers: basewdrawing,
 format: image/png,
 transparent: false
},
{ 
 visibility: true
}
);



If I have the layer go straight to the WMS Server, everything works fine. 
But I love how fast TileCache can seed my layers so I really want to use it
to seed my layers.

I hope I've provided enough information for some assistance.
-- 
View this message in context: 
http://n2.nabble.com/Can%27t-get-OpenLayers-to-Co-operate-with-TileCache-resolutions-tp3198651p3198651.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] Can't get OpenLayers to Co-operate with TileCache resolutions

2009-07-02 Thread soatley

With a little more fooling around, I have found that it has to do with the
MetaTiling

My WMS Server is Manifold 8.0 and it can only write out PNG images.  I am
using .NET to  write out the binary stream to TileCache from Manifold.  I
don't think it is an Interlacing issue because TC would complain if I sent
it an interlaced PNG.

Also, if I turn MetaTile off and generate each tile individually, it works
fine (without any .NET code changing).  The problem with this is that I
don't get any speed benefit when seeding my layers and it takes days to seed
a layer.

I've  http://yfrog.com/5bexamplemqrp linked  to a screen shot of what
happens when I have metaTiling on.  On the left half of the image, you can
see that there is an issue with how the road center lines are rendered.


Still looking for some assistance from anyone who may have come across any
issues like this.



soatley wrote:
 
 Hopefully someone can see what I must be doing wrong  
 
 I have been trying to get TileCache (most recent from site) to work nicely
 with OL 2.8 for a week and it just doesn't seem to be working perfectly.
 
 [snip...]
 

-- 
View this message in context: 
http://n2.nabble.com/Can%27t-get-OpenLayers-to-Co-operate-with-TileCache-resolutions-tp3198651p3199002.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] Can't get OpenLayers to Co-operate with TileCache resolutions

2009-07-02 Thread soatley

Getting closer yet  

I figured out that it has to do with the metaSize parameter.  I tried
setting it to the default (5,5) and the problems were corrected.  I am able
to get it up to 8,8 without a problem.  Once I hit 9,9 or above, I start
getting oddities - the higher I go, the more I get.  Wierd.

One thing I am not noticing is that OpenLayers is requesting tiles that are
way outside my bounds.  For example, on my Zoom level 0, it is asking for:
/tilecache/basewdrawing/00/000/000/028/000/000/024.png

This is way out because my zoom level 0 is only 1 tile (256X256) and the
entire map takes up about 1/10th of the tile.

Has anyone else had this happen to them?  The client doesn't get any error
messages, but there are a ton of 404's happening in the background along
with the increased traffic from the browser to the server attempting to get
all these crazy tiles.

Shawn



soatley wrote:
 
 With a little more fooling around, I have found that it has to do with the
 MetaTiling
 
 My WMS Server is Manifold 8.0 and it can only write out PNG images.  I am
 using .NET to  write out the binary stream to TileCache from Manifold.  I
 don't think it is an Interlacing issue because TC would complain if I sent
 it an interlaced PNG.
 
 [snip...]
 
 

-- 
View this message in context: 
http://n2.nabble.com/Can%27t-get-OpenLayers-to-Co-operate-with-TileCache-resolutions-tp3198651p3199157.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] Error in Tile Cache configh current x value too far from tile corner?

2009-06-30 Thread soatley

I am running into this issue now also.  How many decimal places would be OK?

Here are my resolutions:
850
425
212.5
106.25
53.125
26.5625
13.28125
6.640625
3.3203125
1.66015625
0.830078125
0.4150390625
0.20751953125
0.103759765625
0.0518798828125

As you can see, if I rounded my resolutions off totally, it would render a
number of the zoom levels useless.  I've tried 2 decimal places, but still
get the same effect.

Thanks,
Shawn

Christopher Schmidt-2 wrote:
 
 On Sun, Nov 25, 2007 at 05:55:29PM -0600, Lance Dyas wrote:
 The image urls.. are all returning like this... 
 
 An error occurred: Current x value 15.995916 is too far from tile corner
 x 15.996094
 
 Round all your values, in OL and TC, off (on maxExtent and
 maxResolution).
 
 Regards,
 -- 
 Christopher Schmidt
 MetaCarta
 ___
 Users mailing list
 Users@openlayers.org
 http://openlayers.org/mailman/listinfo/users
 
 

-- 
View this message in context: 
http://n2.nabble.com/Error-in-Tile-Cache-configh-current-x-value-too-far-from-tile-corner--tp1826527p3184099.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] Adjust sensitivity of keyboard control and mouse wheel

2009-06-24 Thread soatley

Hello,

Is there anyway to adjust the sensitivity of the keyboard controls (panning)
and the mouse wheel (zooming)?  It would be nice if panning would pan a
little more for each key press and the zoom wheel would be a little less
sensitive.

Shawn
-- 
View this message in context: 
http://n2.nabble.com/Adjust-sensitivity-of-keyboard-control-and-mouse-wheel-tp3149822p3149822.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] Adjust sensitivity of keyboard control and mouse wheel

2009-06-24 Thread soatley

Wow!

That is perfect!  This is exactly it.

Thank you!
Shawn


Andreas Hocevar-2 wrote:
 
 Hi,
 
 On Wed, Jun 24, 2009 at 6:27 PM, soatleysh...@niagarafalls.ca wrote:
 Is there anyway to adjust the sensitivity of the keyboard controls
 (panning)
 and the mouse wheel (zooming)?  It would be nice if panning would pan a
 little more for each key press and the zoom wheel would be a little less
 sensitive.
 
 Assuming you want this application-wide, the tweaks below have to be
 done before creating the map object:
 
 // drag movement in pixels, default is 75
 OpenLayers.Control.KeyboardDefaults.prototype.slideFactor = 200; //
 default is 50
 
 For the mousewheel, a bit more customisation is required: if you want
 to spin the wheel more before zooming occurs, you need a counter for
 the wheelUp and wheelDown handlers:
 
 OpenLayers.Control.Navigation.prototype.counter = 0;
 OpenLayers.Control.Navigation.prototype.wheelUp = function(evt) {
 this.counter++;
 if(this.counter  2) {
 this.counter = 0;
 this.wheelChange(evt, 1);
 }
 };
 OpenLayers.Control.Navigation.prototype.wheelDown = function(evt) {
 this.counter--;
 if(this.counter  -2) {
 this.counter = 0;
 this.wheelChange(evt, -1);
 }
 };
 
 In the above setup, you need to spin the wheel three times as far as
 with the default config for the zoom to happen. If you want to make it
 even less sensitive, replace the 2 (and -2 respectively) with a higher
 number.
 
 Regards,
 Andreas.
 

 Shawn
 --
 View this message in context:
 http://n2.nabble.com/Adjust-sensitivity-of-keyboard-control-and-mouse-wheel-tp3149822p3149822.html
 Sent from the OpenLayers Users mailing list archive at Nabble.com.

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

 
 
 
 -- 
 Andreas Hocevar
 OpenGeo - http://opengeo.org/
 Expert service straight from the developers.
 ___
 Users mailing list
 Users@openlayers.org
 http://openlayers.org/mailman/listinfo/users
 
 

-- 
View this message in context: 
http://n2.nabble.com/Adjust-sensitivity-of-keyboard-control-and-mouse-wheel-tp3149822p3150950.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] Map Aspect Ratio Seems Off (Makes layers wide)

2009-06-22 Thread soatley

Andreas,

Thank you for that information!  You've solved my problem and even fixed one
of my todo items of getting the MousePosition into UTM!

Thanks
Shawn


Andreas Hocevar-2 wrote:
 
 Hi,
 
 On Fri, Jun 19, 2009 at 10:38 PM, soatleysh...@niagarafalls.ca wrote:
 
 Your co-workers are right. Maps in geographic coordinates (EPSG:4326)
 look like that. The further you get away from the equator, the more
 the map will be shrunk in latitudinal direction. This is not a bug,
 but a matter of choosing the appropriate map projection.
 
 The GIS staff tell me that our data is projected in UTM 17N NAD83.
 
 The EPSG code for this projection is probably EPSG:26917. See
 http://spatialreference.org/ref/epsg/26917/
 
 So the two things to change in your code is that you set the
 projection to EPSG:26917 instead of EPSG:4326, set units to m
 (meters), and provide the maxExtent in projected coordinates.
 
 Regards,
 Andreas.
 
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/Map-Aspect-Ratio-Seems-Off-%28Makes-layers-wide%29-tp3122010p3138291.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] Map Aspect Ratio Seems Off (Makes layers wide)

2009-06-19 Thread soatley

I am having an issue with the aspect ratio of my map and my knowledge of
projections is not that good, but my GIS co-workers are telling me that is
probably the cause.  The attached image(
http://n2.nabble.com/file/n3122010/example.jpg example.jpg ) shows what the
map should look like (our existing mapping software) and how OL is
displaying it.

Here is how I instantiate my map object:

OpenLayers.Layer.cWMS = OpenLayers.Class(OpenLayers.Layer.WMS, {
isClickable: false

});


 options = {
projection: new OpenLayers.Projection(EPSG:4326),
maxExtent: new OpenLayers.Bounds(-79.287519, 42.920835, -78.956522,
43.156),
tileSize: new OpenLayers.Size(256, 256),
maxResolution: 2 / 256,
numZoomLevels: 15,

controls: [new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.MousePosition({ div:
$j(#position).get(0) }),
new OpenLayers.Control.LoadingPanel(),
new OpenLayers.Control.ScaleBar()
]
};


map = new OpenLayers.Map('map', options);

var BaseMap = new OpenLayers.Layer.cWMS(Base Map,
[http://wmsServer/wms.png,http://wmsServer2/wms.png;],
{ 
 layers: BaseW Drawing,Background Colour,RoadCL 
Drawing,Surrounding
Lands Labels,
 format: image/png,
 transparent: false
},
{ 
 visibility: true,
 isClickable: false
}
);

map.addLayers([BaseMap]);





You can see that I've extended the WMS layer just so that I can add the
'isClickable' property.  The map was skewed before I created that, so that
is not the issue.

The GIS staff tell me that our data is projected in UTM 17N NAD83.  

I hope I have provided enough information for someone to help me.

Thanks!
Shawn
-- 
View this message in context: 
http://n2.nabble.com/Map-Aspect-Ratio-Seems-Off-%28Makes-layers-wide%29-tp3122010p3122010.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] MapServer Layer for ECW creating blank tiles

2009-06-17 Thread soatley

Hopefully someone with some Mapserver knowledge can help me out as I am
having problems getting Mapserver to work with OL.

First a little background.  I have OL 2.8 rc6 up and running with multiple
layers being pulled via my WMS server (Manifold).  I have been having
problems getting Manifold to generate the tiles for ECW files so I am
turning to MapServer to hopefully solve the problem.  I am not a GIS person,
I am a web programmer, so please go easy.

Here is the output of gdalinfo on my ECW File:

Driver: ECW/ERMapper Compressed Wavelets
Files: ortho.ecw
Size is 75010, 115010
Coordinate System is:
PROJCS[NUTM17,
GEOGCS[NAD83,
DATUM[North_American_Datum_1983,
SPHEROID[GRS 1980,6378137,298.257222101,
AUTHORITY[EPSG,7019]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY[EPSG,6269]],
PRIMEM[Greenwich,0,
AUTHORITY[EPSG,8901]],
UNIT[degree,0.0174532925199433,
AUTHORITY[EPSG,9108]],
AXIS[Lat,NORTH],
AXIS[Long,EAST],
AUTHORITY[EPSG,4269]],
PROJECTION[Transverse_Mercator],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,-81],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,50],
PARAMETER[false_northing,0],
UNIT[Meter,1]]
Origin = (646999.000,478.9998600)
Pixel Size = (0.200,-0.200)
Corner Coordinates:
Upper Left  (  646999.000, 4780001.000) ( 79d11'30.77W, 43d 9'30.53N)
Lower Left  (  646999.000, 4756999.000) ( 79d11'52.64W, 42d57'5.23N)
Upper Right (  662001.000, 4780001.000) ( 79d 0'26.85W, 43d 9'19.50N)
Lower Right (  662001.000, 4756999.000) ( 79d 0'50.94W, 42d56'54.27N)
Center  (  654500.000, 4768500.000) ( 79d 6'10.32W, 43d 3'12.52N)
Band 1 Block=75010x1 Type=Byte, ColorInterp=Red
  Overviews: arbitrary
Band 2 Block=75010x1 Type=Byte, ColorInterp=Green
  Overviews: arbitrary
Band 3 Block=75010x1 Type=Byte, ColorInterp=Blue
  Overviews: arbitrary


Viewing some documentation and using google, I created this map file:

MAP
PROJECTION  init=epsg:4326
END

SIZE 256 256
STATUS ON
EXTENT 646999.000 4756999.000 662001.000 4780001.000

UNITS METERS


LAYER
NAME orthoEnhanced
TYPE RASTER
STATUS ON
PROJECTION init=epsg:4326
END

DATA O:\ortho.ecw


CLASS
STYLE
COLOR 110 50 100
OUTLINECOLOR 200 200 200
SYMBOL 0
END
END
END 
END


And then created the layer for OpenLayers:

var msecw = new OpenLayers.Layer.MapServer(OpenLayers WMS,
http://127.0.0.1:81/cgi-bin/mapserv.exe?map=ecw.map;, {
layers: 'orthoEnhanced' });

map.addLayer(msecw);


All of my tiles are coming blank.  Here is what Firebug says for the
MapServer requests:

http://127.0.0.1:81/cgi-bin/mapserv.exe?map=ecw.maplayers=orthoEnhancedmode=mapmap_imagetype=pngmapext=-79.162519+42.920835+-79.100019+42.983335imgext=-79.162519+42.920835+-79.100019+42.983335map_size=256+256imgx=128imgy=128imgxy=256+256


One thing I can see is that my extents in the request are Lat Long and the
Extents in the Map file are UTM 17.  Should the map file be changed to Lat
Long? (And how do I convert the values)

If I were to hack around on the Mapserv.exe url, and remove everything in
the querystring except the following:

http://127.0.0.1:81/cgi-bin/mapserv.exe?map=ecw.mapmode=mapmap_imagetype=pnglayers=orthoEnhanced


then I get a picture of the full ortho.  In my mind, that means that
MapServer can read the ecw file and generate a 256X256 PNG.  

Once I append the coordinates that url, then I just get blank tiles.

Any help would be greatly appreciated!!!

Thanks,
Shawn
-- 
View this message in context: 
http://n2.nabble.com/MapServer-Layer-for-ECW-creating-blank-tiles-tp3092922p3092922.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] MapServer Layer for ECW creating blank tiles

2009-06-17 Thread soatley

Chris, thanks for that tip.  It really helps me to troubleshoot it.  I think
I have figured out the problem, but not sure how to fix it.

Now that it is sending WMS requests, I can see the url and compare it to my
other vector tiles.  The problem is that the WMS requests are going out with
Lat/Long values.  When I converted the BBOX value to UTM it rendered
perfectly.  

My question is how can I do this using OL?  Can I have that layer request
coordinates in UTM (17N) so that the URL hitting MapServer already has the
value?

Thanks again,
Shawn


Christopher Schmidt-2 wrote:
 
 
 
 Instead of using a MapServer layer, instead add the following to your
 mapfile:
 
   web
 metadata
   wms_srs EPSG:4326
 end
   end
 
 If your OpenLayers Map is in a different projection, use
 EPSG:ThatProjection instead.  
 
 Then, change MapServer above to WMS (nothing else) and see where you
 can get. I think you're likely dealing with a projection issue, and the
 WMS layer will make it easier to debug.
 
 -- Chris
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/MapServer-Layer-for-ECW-creating-blank-tiles-tp3092922p3093597.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] MapServer Layer for ECW creating blank tiles

2009-06-17 Thread soatley


I think I may approach this a little different.  I created a custom tile
caching handler and I can pass parameters to so that it will retrieve the
image from MapServer.  


Is it possible to provide a custom url to the request string?  For example,
appending another value to the end of the request string for each tile?




Christopher Schmidt-2 wrote:
 
 On Wed, Jun 17, 2009 at 08:43:13AM -0700, soatley wrote:
 You already have a WMS set up in OpenLayers, right?
 http://faq.openlayers.org/map/how-do-i-set-a-different-projection-on-my-map/
 maybe relevant.
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/MapServer-Layer-for-ECW-creating-blank-tiles-tp3092922p3094118.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] MapServer Layer for ECW creating blank tiles

2009-06-17 Thread soatley

Chris,

Forget about it  I should have tried the simple stuff first.  By
appending my custom querystring value to the URL, openlayers just appended
it's values to the end.  

Thanks for pointing me in the right direction with the WMS Map config.  That
was the turning point.

Shawn


soatley wrote:
 
 
 I think I may approach this a little different.  I created a custom tile
 caching handler and I can pass parameters to so that it will retrieve the
 image from MapServer.  
 
 
 Is it possible to provide a custom url to the request string?  For
 example, appending another value to the end of the request string for each
 tile?
 
 
 
 
 Christopher Schmidt-2 wrote:
 
 On Wed, Jun 17, 2009 at 08:43:13AM -0700, soatley wrote:
 You already have a WMS set up in OpenLayers, right?
 http://faq.openlayers.org/map/how-do-i-set-a-different-projection-on-my-map/
 maybe relevant.
 
 
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/MapServer-Layer-for-ECW-creating-blank-tiles-tp3092922p3094170.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] Detect if key pressed during click

2009-06-15 Thread soatley

I have a custom handler for my click event that is my default click handler
to retrieve information from my WMS server:

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
'single': true,
'double': false,
'pixelTolerance': 0,
'stopSingle': false,
'stopDouble': false
},

initialize: function(options) {
this.handlerOptions = OpenLayers.Util.extend(
{}, this.defaultHandlerOptions
);
OpenLayers.Control.prototype.initialize.apply(
this, arguments
);
this.handler = new OpenLayers.Handler.Click(
this, {
'click': this.onClick
}, this.handlerOptions
);
},

onClick: function(e) {
/* do standard click function: query WMS, get feature, do popup,etc.
*/
}
});



How can I tell if someone was pressing the control key at the same time?  I
saw some keyMask information and wasn't sure if I had to setup a different
Click Handler in order to get it to work.

The purpose for this is to determine whether someone wants to select
multiple items (properties, roads, etc.) or not.  If the user is selecting a
single item (CTRL not pressed) then query the WMS server, show the popup and
create the feature.  If the user is selecting multiple items (CTRL is
pressed) then query the WMS server and highlight the property and show the
list of selected items in another window.  I can create my own code to do
all the WMS /feature/window stuff, just need some assistance detecting the
CTRL with the click and sending it to a different function.

Thanks!
Shawn

-- 
View this message in context: 
http://n2.nabble.com/Detect-if-key-pressed-during-click-tp3082415p3082415.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] Framed Cloud Popup - Tail interferring with layer

2009-06-12 Thread soatley

I am having a problem using the popups to display data and have confirmed it
with the 'Popup Matrix' example :
http://www.openlayers.com/dev/examples/popupMatrix.html

To re-create, click on the very bottom row of popups (overflow:hidden) of
the first 'min size (400X400)' column.  You should see the popup appear
above the row.  Now try and click on one of the markers right by the tail. 
The easiest one to try is the marker right above the one you just clicked
on.  

This happens in Firefox, Safari and IE 8  (haven't tried 7).  In
Firefox/Safari, it is worse than IE.  In IE, it is just the markers by the
tail that are affected.  In the others, it is the markers that are below the
popup but parallel to the tail.  

This is a problem for me because I use popups to show property information
and quite often, the properties are beside one-and-other or in that area
below the popup.  

Has anyone tried a work-around for this?

Thanks,
Shawn

-- 
View this message in context: 
http://n2.nabble.com/Framed-Cloud-Popup---Tail-interferring-with-layer-tp3067060p3067060.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] Add Feature and Pan into View

2009-05-21 Thread soatley

Hello,

Does anyone know how to have the map pan when adding a feature to a vector
layer so that the entire feature is in view?

Here's my code so far that works:
//define the popup
infoPopup = new OpenLayers.Popup.FramedCloud(info,
 mouseLoc,
 null,
 div
style=\padding:5px;font-size:0.8em;\Loading.../div,
 null, true, onPopupClose);
map.addPopup(infoPopup);

 //load the url for the popup data
OpenLayers.loadURL(infoUrl, '', this, showTip);


In the showTip function, I parse the data that is returned, update the
content popup and create a feature.  The feature coordinates (WKT) are
passed with the response.

var f = new OpenLayers.Format.WKT();
infoFeature = f.read(marker.find(points).text());
infoLayer.addFeatures([infoFeature], { style: default });
infoPopup.contentHTML = marker.find(result).text();
infoPopup.setContentHTML();
infoFeature.popup = infoPopup;

This code works great.  If the popup is off the screen it pans into view. 
Great!  But, how can I do the same if the feature (a parcel) is partially
off the screen?


-- 
View this message in context: 
http://n2.nabble.com/Add-Feature-and-Pan-into-View-tp2952437p2952437.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] Add Feature and Pan into View

2009-05-21 Thread soatley

Alexandre,
Thanks for your reply.

Can you explain the BBOX strategy a little more?  It sounds like it will do
the trick, but I am still new to OpenLayers.  It sounds like the zoom level
would change if I set the extent.  (Or am I wrong?)  I would just like it to
pan, similar to how the Popup pans, in order to get it into view.

Shawn


Alexandre Dube wrote:
 
 Hi,
 
 You could register a beforefeatureselected event on your vector layer 
 and set the map extent according to the feature's extent. I think that 
 if you use the BBOX strategy, since the feature was already drawn it 
 should remain the same when the map automatically pan/zoom to the 
 feature's extent.
 
 What do you think ?
 
 Alexandre
 
 soatley wrote:
 Hello,

 Does anyone know how to have the map pan when adding a feature to a
 vector
 layer so that the entire feature is in view?

 Here's my code so far that works:
 //define the popup
 infoPopup = new OpenLayers.Popup.FramedCloud(info,
  mouseLoc,
  null,
  div
 style=\padding:5px;font-size:0.8em;\Loading.../div,
  null, true, onPopupClose);
 map.addPopup(infoPopup);
 
  //load the url for the popup data
 OpenLayers.loadURL(infoUrl, '', this, showTip);


 In the showTip function, I parse the data that is returned, update the
 content popup and create a feature.  The feature coordinates (WKT) are
 passed with the response.

 var f = new OpenLayers.Format.WKT();
 infoFeature = f.read(marker.find(points).text());
 infoLayer.addFeatures([infoFeature], { style: default });
 infoPopup.contentHTML = marker.find(result).text();
 infoPopup.setContentHTML();
 infoFeature.popup = infoPopup;

 This code works great.  If the popup is off the screen it pans into view. 
 Great!  But, how can I do the same if the feature (a parcel) is partially
 off the screen?


   
 
 
 -- 
 Alexandre Dubé
 Mapgears
 www.mapgears.com
 
 ___
 Users mailing list
 Users@openlayers.org
 http://openlayers.org/mailman/listinfo/users
 
 

-- 
View this message in context: 
http://n2.nabble.com/Add-Feature-and-Pan-into-View-tp2952437p2953370.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

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