Gagan Bansal | 1 Oct 2010 11:19
Picon

[OpenLayers-Users] Re: add an arrow to line feature


Hi,

I was also looking for this feature, i.e. showing the line direction. So
based on Sveen suggestion I have written this example 

http://gaganb.wordpress.com/2010/09/30/draw-line-direction-on-openlayers-feature/

Regards,
Gagan 
--

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/add-an-arrow-to-line-feature-tp5234002p5590646.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
Planet)x | 1 Oct 2010 17:53
Picon
Favicon

[OpenLayers-Users] ZoomBox not working when using Ext toolbar and GeoExt Action


I am trying to add a zoombox control (tried both zoom in defaults and
out:true) to a toolbar attached to my mappanel. Unfortunately the zoom box
does not appear to be working. If I change the Zoombox control to a ZoomIn()
it works fine. Not sure what is different or if I am missing something and I
appreciate assistance to get the zoombox working. Tried holding down shift
etc and zooming after but as soon as I click the button its like nothing is
happening. Appreciate any assistance.

//Begin ToolBar
                var ctrl, toolbarItems = [], action, actions = {};

                // ZoomToMaxExtent control, a "button" control
                action = new GeoExt.Action({
                control: new OpenLayers.Control.ZoomBox(),
                map: map,
                text: "Zoom In",
                tooltip: "Zoom In"
                });
                actions["zoom_in"] = action;
                toolbarItems.push(action);             

           //Define MapPanel for use with GeoExt

            var mapPanel = new GeoExt.MapPanel({
            collapsed: false,
            height: 800,
            renderTo: '',
            map: map,
            center: lonLat,
(Continue reading)

Planet)x | 1 Oct 2010 18:20
Picon
Favicon

[OpenLayers-Users] Re: ZoomBox not working when using Ext toolbar and GeoExt Action


So not only is the ZoomBox not working but any control I try to add that
isn't a button is not working. Below is my original code that I was using a
Panel control with and all of the buttons were working. If I add the panel
to the Ext Toolbar then all the buttons work but of course this isn't what I
want. Can someone explain to me why these buttons work on my panel but
adding the same exact control to the toolbar is not working? Thanks.

//declare all Map Controls
var nav = new OpenLayers.Control.NavigationHistory({title: "Pan Tool - Click
and drag on map window", displayClass: 'olControlButtonPrevious'});
var mouseDefaults = new OpenLayers.Control.MouseDefaults({title: "Pan Tool -
Click and drag on map window"});
var drawFeature = new OpenLayers.Control.DrawFeature(vlayer,
OpenLayers.Handler.Path, {title: "Draw Redline Feature", handlerOptions:
{style: s}});
var btnPrint = new OpenLayers.Control.Button({trigger: triggerPrint, title:
"Print Page", displayClass: 'olControlButtonPrint'});
var btnHelp = new OpenLayers.Control.Button({trigger: triggerHelp, title:
"Redgis Help", displayClass: 'olControlButtonHelp'});
var btnTutorial = new OpenLayers.Control.Button({trigger: triggerTutorial,
title: "Redgis Tutorials", displayClass: 'olControlButtonTutorial'});
var zoomIn = new OpenLayers.Control.ZoomBox({title:"Zoom in. Click on map or
click and drag to zoom in."}); 
var zoomOut = new OpenLayers.Control.ZoomBox({title:"Zoom out. Click on map
or click and drag to zoom out.", displayClass: 'olControlZoomOutBox', out:
true});
 var btnRemoveRedlines = new OpenLayers.Control.Button({trigger:
triggerRemoveRedlines, title: "Remove Redlines", displayClass:
'olControlButtonHome'});
(Continue reading)

Planet)x | 1 Oct 2010 21:33
Picon
Favicon

[OpenLayers-Users] Re: ZoomBox not working when using Ext toolbar and GeoExt Action


So I got this to work now - if I did not use the togglegroup and group
options my other controls were not being deactivated. It seem to work fine
for the control now with the following code -

        var zoomin_action = new GeoExt.Action({
        text: "Zoom In",
        control: new OpenLayers.Control.ZoomBox({alwaysZoom:true}),
        map: map,
        // button options
        toggleGroup: "tools",
        allowDepress: false,
        tooltip: "Zoom In",
        // check item options
        group: "tools"
        });
--

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/ZoomBox-not-working-when-using-Ext-toolbar-and-GeoExt-Action-tp5591918p5592633.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
Arnd Wippermann | 2 Oct 2010 00:30
Picon

AW: [OpenLayers-Users] Draggable and Selectable features on map

Hi,
 
if you add first the drag control and afterwards the selectfeature control, then you can drag a feature without selecting and select a feature. Only disadvantage is the moving cursor for selecting a feature.
 
var lyr = map.layers[1];
 
ctrlDragFeature = new OpenLayers.Control.DragFeature(lyr);
map.addControl(ctrlDragFeature);
ctrlDragFeature.activate();
 
ctrlSelectFeatures = new OpenLayers.Control.SelectFeature(
        lyr,
        {
            clickout: true, toggle: false,
            multiple: false, hover: false,
            toggleKey: "ctrlKey", // ctrl key removes from selection
            multipleKey: "shiftKey" // shift key adds to selection
        }
)
 
map.addControl(ctrlSelectFeatures);
ctrlSelectFeatures.activate();
 
Arnd

Von: openlayers-users-bounces-qjLDD68F18NyQMAyxoHuMA@public.gmane.org [mailto:openlayers-users-bounces-qjLDD68F18NyQMAyxoHuMA@public.gmane.org] Im Auftrag von James Humphreys
Gesendet: Freitag, 1. Oktober 2010 18:30
An: P Kishor
Cc: openlayers-users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
Betreff: Re: [OpenLayers-Users] Draggable and Selectable features on map

What I want is that you simply click the marker, hold the button down, drag and drop.
(ignore the balloon in this example)

As I understand it, if I use the ModifyFeature control I'll have to click it first (click and release) to select the marker. Then do my click/drag/drop.
As in this example:

In the openlayers example above, draw a point, then tick "modify feature / allow dragging". You have to click to select, then you're allowed to drag/drop.

Bit fiddly to explain - hope that's clear!



On 1 October 2010 17:19, P Kishor <punk.kish-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
On Fri, Oct 1, 2010 at 11:10 AM, James Humphreys
<humphreysjames-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Alexandre,
> Thanks for your suggestion. It's a good idea, but not quite the effect I'd
> like to achieve. If I understand correctly, the user would have to actually
> select the feature first then drag? I'd like the drag to "just work" without
> having to click it first.


How can you drag something without first clicking and selecting? Your
request is not clear. Care to elaborate?

> Unfortunately, I don't have time to try out the code right now (on Sunday
> maybe?) but if do figure out how to do this I'll make sure I post it up for
> everyone.
> Thanks,
> James
>
> On 30 September 2010 13:18, Alexandre Dube <adube-CX6nfA+BadZWk0Htik3J/w@public.gmane.org> wrote:
>>
>> Hi James,
>>
>>   You could try to replace both the SelectFeature and DragFeature controls
>> by a ModifyFeature control, which contains a SelectFeature control itself so
>> you could listen to its "featureselected" event to display your popup.
>> Dragging the marker while it's selected should work.
>>
>> Regards,
>>
>> Alexandre
>>
>>
>> On 10-09-29 04:43 PM, James Humphreys wrote:
>>
>> Hi,
>>
>> I'd like to have markers on the map that have a baloon appear when I click
>> them, and are also draggable. I've created an OpenLayers map with markers
>> using a vector layer. When I click on the markers I'd like a baloon to pop
>> up (a FramedCloud). That's easy enough - I added a SelectFeature control
>> which, when clicked, add a FramedCloud to the map. Secondly, I'd like those
>> markers to be draggable, so I added a DragFeature control to the vector
>> layer.
>> It look like those two Controls can't co-exist. If I add them both, the
>> SelectFeature control doesn't work.
>>
>> I've put a quick example up at
>> http://www.humphreys.be/james/selectanddrag/selectanddrag.html
>> Here I've activated both features, so only "drag" works. You can download
>> the selectanddrag.HTML and selectanddrag.JS file to your PC, modify and play
>> with them. If you switch off the dragFeature, the selectControl works fine.
>>
>> I saw this has been discussed before, back in Feb:
>> http://osgeo-org.1803224.n2.nabble.com/Click-on-OpenLayers-Feature-Vector-td4631284.html
>> According to this post the two Controls simply aren't compatible.
>>
>> Has the situation changed? Does anyone know how I can create a marker that
>> can have a bubble appear when I click it AND is draggable?
>> I'd love to hear anyone's opinion on this before I delve head first into
>> writing my own custom control (and I'm not that great at Javascript so it
>> could take a while...)
>>
>> Thanks,
>>
>>
>> James
>>
>>
>> Here's a code snippet:
>>
>> map = new OpenLayers.Map('map');
>>
>> var layer = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
>>     map.addLayer(layer);
>>
>> placesVL = new OpenLayers.Layer.Vector("My places", {... });
>> map.addLayer(placesVL);
>>
>> var marker1 = new OpenLayers.Feature.Vector(getPoint(-0.58, 51.8));
>> var marker2 = new OpenLayers.Feature.Vector(getPoint(-0.53, 51.2));
>> placesVL.addFeatures([marker1, marker2]);
>>
>> selectControl = new OpenLayers.Control.SelectFeature(placesVL,
>>                 {onSelect: onFeatureSelect, onUnselect:
>> onFeatureUnselect});
>> map.addControl(selectControl);
>> selectControl.activate();
>>
>> var dragFeature = new OpenLayers.Control.DragFeature(placesVL,
>> {'onComplete': onDragPlaceComplete});
>> map.addControl(dragFeature);
>> dragFeature.activate();
>>
>> _______________________________________________
>> Users mailing list
>> Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>> --
>> Alexandre Dubé
>> Mapgears
>> www.mapgears.com
>>
>> _______________________________________________
>> Users mailing list
>> Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>
> _______________________________________________
> Users mailing list
> Users-qjLDD68F18NyQMAyxoHuMA@public.gmane.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>



--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================

_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Alphatran | 2 Oct 2010 09:36
Picon
Favicon

[OpenLayers-Users] Re: GeoServer Proxy Extension OpenLayers


Hello my friends,

I read many times your posts above but finally I don't have answer for my
situation:

My website is developing in Visual Studio: URL is 

http://localhost:2456/default.aspx

Inside this page I made a request to show popup feature info:

OpenLayers.loadURL("http://localhost:8080/geoserver/wms", params, this,
addPopup, addPopup);

Where: http://localhost:8080/geoserver is my geoserver URL

The request OpenLayers.loadURL above always response null.

I tried to set ProxyHost for OpenLayers but response is still null

But I take a look to Layer Preview in GeoServer, select OpenLayers for
Common Formats then new page shown, I found that the OpenLayers.loadURL
worked perfectly.

My friends! Please help to to solve this. Thanks very much for your time

http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap.........
--

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GeoServer-Proxy-Extension-OpenLayers-tp3998936p5593809.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
Diego Guidi | 2 Oct 2010 10:22
Picon
Gravatar

[OpenLayers-Users] ProxyHost as c# httphandler

if someone needs to configure faster a ProxyHost to use with
openlayers, use this:
http://code.google.com/p/iisproxy/issues/detail?id=8

Diego Guidi
Imran Rajjad | 3 Oct 2010 00:30
Picon

Re: [OpenLayers-Users] Re: add an arrow to line feature

Well I figured it out , instead of adding a line, add a collection of
geometry having a line and point.. set the shape of point to traigle
and calculate the rotation using simple atan(dy/dx). I will share the
code on Monday with you

regards,
Imran

On Fri, Oct 1, 2010 at 2:19 PM, Gagan Bansal
<gaganbansal123@...> wrote:
>
> Hi,
>
> I was also looking for this feature, i.e. showing the line direction. So
> based on Sveen suggestion I have written this example
>
> http://gaganb.wordpress.com/2010/09/30/draw-line-direction-on-openlayers-feature/
>
> Regards,
> Gagan
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/add-an-arrow-to-line-feature-tp5234002p5590646.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users@...
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>

--

-- 
I.R
Alphatran | 3 Oct 2010 04:36
Picon
Favicon

[OpenLayers-Users] double click fired zoom in and show popup


Hello my friends,

My map have registered a click event as below:

map.events.register('click', map, getInfo);

the getInfo function will getWMSFeatureInfo and show on the new Popup

But when I tried to double click on the map, OpenLayers do 2 jobs:
- Zoom In
- Show Popup

I wondering how can I distinguish between single click and double click. So
at the getInfo function I will check and ignore when user make a double
click.

I hope you will help me to solve this
Thanks much for your time.

--

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/double-click-fired-zoom-in-and-show-popup-tp5595368p5595368.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
ilias kanellos | 3 Oct 2010 15:40
Picon

[OpenLayers-Users] Image Layer transparency

Hello everybody,

I have coded a function that creates an image layer. In this function one of the arguments is how transparent you want the image to be. My code looks like this:

                function createImageOverlay(imageURL, bounds, width, height, transparencyFactor)
                {
                    var newImageLayer = new OpenLayers.Layer.Image(
                                            //Layer name
                                            "My Image",
                                            //Layer Url
                                            imageURL,
                                            //Image span coordinates
                                            //bounds[0] == bottom left
                                            //bounds[1] == top right
                                            new OpenLayers.Bounds(bounds[0].lon,bounds[0].lat,bounds[1].lon,bounds[1].lat),
                                            //pixel size of image
                                            //"size of the image as it should display when fully zoomed out"
                                            new OpenLayers.Size(width, height),                                           
                                            {
                                                projection: "EPSG:900913",
                                                isBaseLayer: false,
                                                visibility: true
                                            }
                                        )
                    if ((transparencyFactor<= 1.0)&&(transparencyFactor>=0.0))
                            newImageLayer.setOpacity(transparencyFactor);
                    else newImageLayer.setOpacity(1.0);
                    return newImageLayer;
                }

However the image layer doesn't display right away, instead i first have to zoom in a level before I can see it, after it's been added to the map. Furthermore, while the transparency seems to works for a few zoom levels, after that the image stops being transparent, and it stays this way even if I zoom out again. Does anybody know where the problem might be?

_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Gmane