[Users] ext.form.textfield to Display OpenLayers MousePosition

IT Intern itintern12 at gmail.com
Mon Oct 4 17:52:31 CEST 2010


Ok, I managed to get the js file for the MousePositionItem widget.  Using
this example as a guide,
http://dev.geoext.org/sandbox/cmoullet/ux/Toolbar/examples/ToolbarExample.html,
I still have some concerns.  In the example they have the mouseposition in
the same place OpenLayers will put it for me.  I'd really like to get the
mouseposition on the bbar itself, and even better, in a text field on the
bbar.  I have tried several approaches and none have yet to work:

var mousePositionItem = new GeoExt.ux.Toolbar.MousePositionItem({
                map: map,
                controlOptions: {
                numDigits: 0
                }
               });

bbar: [
                {
                    xtype: "textfield",
                    text: mousePositionItem.getText()          //This broke
the code, but is there a function like this?
                },
                {
                    xtype: "label",
                    text: "Scale = 1 : "
                }

                ],
                items: [ mousePositionItem,{ //This still kept the
mouseposition text on the map itself not on the bbar :(
                    xtype: "gx_zoomslider",
                    vertical: true,
                    height: 300,
                    x: 10,
                    y: 20,
                    plugins: new GeoExt.ZoomSliderTip()
                }]

My other approach was putting the mousePositionItem in the bbar field

bbar: [ mousePositionItem,  //was still on the map and not actually on the
bbar :(
                {
                    xtype: "textfield",
                    text: mousePositionItem.getText()          //This broke
the code, but is there a function like this?
                },
                {
                    xtype: "label",
                    text: "Scale = 1 : "
                }

                ]

Thanks for all the help,

elshae

On Mon, Oct 4, 2010 at 11:10 AM, IT Intern <itintern12 at gmail.com> wrote:

> Thank you Frederic for your reply. This may sound really funny, but I am
> actually struggling to use the patch.  I downloaded the file and I have no
> idea where to put it or if I have to rename it.  I've been looking through
> the GeoExt UX docs for a while now and am just not clear on how to use this
> library.  Someone please help me and I am sorry if this seems so noob...
>
> Thanks,
>
> elshae
>
>
> On Sun, Oct 3, 2010 at 8:50 AM, Frederic Junod <
> frederic.junod at camptocamp.com> wrote:
>
>> Hello,
>>
>> Please look at http://trac.geoext.org/ticket/195 (patch 195.1.patch)
>> The patch adds a class (inherited from Ext.Toolbar.TextItem) to
>> display the output from a OpenLayers.Control.MousePosition.
>>
>> fredj
>>
>> On Fri, Oct 1, 2010 at 6:07 PM, IT Intern <itintern12 at gmail.com> wrote:
>> > Hello GeoExt List,
>> >
>> > I have a map in a GeoExt browser.  Id like to add a ext.fom.textfield
>> object
>> > on my mapPanels bottom toolbar which displays the details of a
>> Openlayers
>> > Mouse Position object.  If anyone has done anything like this, please
>> lend
>> > me a hand!
>> >
>> > Much appreciated :),
>> >
>> > elshae
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at geoext.org
>> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
>> >
>> >
>>
>>
>>
>> --
>> Frédéric Junod
>> Camptocamp SA
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101004/4970a439/attachment-0001.htm 


More information about the Users mailing list