Re: [OSM-dev] need some javascript help

2010-03-20 Thread jamesmikedup...@googlemail.com
I have done the basic javascript work now.

http://github.com/h4ck3rm1k3/OAD-Open-Address-Database/blob/master/OAD/root/static/javascript/oad.js

Now I need to setup an nomatim server interface, I am considering setting up
my own, using the alternative names we have loaded into the kosovo osm map.

Mike

On Fri, Feb 26, 2010 at 10:40 PM, jamesmikedup...@googlemail.com <
jamesmikedup...@googlemail.com> wrote:

> yes the performance is horrid. thanks!
> I will look into compressing this all and making it tight.
> it will all be hosted on the server, no need for cross site stuff.
> thanks,
> mike
>
>
> On Fri, Feb 26, 2010 at 10:35 PM, Emilie Laffray  > wrote:
>
>> On 26/02/2010 20:59, jamesmikedup...@googlemail.com wrote:
>> > OK
>> > I have updated the server here :
>> > http://119.161.80.223:3000/Controller
>> > It is running the lastest code.
>> > You can see my demo controller, now I want to change the url of the
>> > top frame based on the selection in the bottom one. I guess it might
>> > be very easy.
>> > there is a great plugin that just allows you to right click on
>> > something and show it in a map.
>> > the minimap plugin for firefox. Something like that is what I want.
>> > but it would be great to be able to also select the location in the
>> > map and update the lat /lon. Even to select a street and attach it
>> > (data mode osm)
>> >
>> > this will be a great tool for osm, please help with it.
>> > we can use it to create databases of addresses and pull them up in the
>> > map, like select a street  and find all data rows with the street name
>> > in it in that current town.
>>
>> You might want to check the parent functionality in Javascript. In the
>> iframe, you may want to use code like this:
>> var firstiframe = parent.getElementById("addresses");
>> firstiframe.src = "http://www.mynewurl";;
>>
>> Please note that this code won't work on your current page as you have a
>> name field instead of an id field, which is what getElementById is
>> getting. Of course, you could use getElementsByName() but the
>> compatibility is not as good. Please check the following page for more
>> information:
>> http://www.quirksmode.org/dom/w3c_core.html
>>
>> However, cross scripting prevention tools might balk at it.
>> Also, for some reason, all files from openlayer are being loaded. YSlow
>> is reporting the following:
>> This page has 205 external Javascript scripts. Try combining them into
>> one.
>>
>> The main openstreetmap site is using only 5 external javascript scripts,
>> so you might want to investigate this for performance reason.
>>
>> Emilie Laffray
>>
>>
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-26 Thread jamesmikedup...@googlemail.com
yes the performance is horrid. thanks!
I will look into compressing this all and making it tight.
it will all be hosted on the server, no need for cross site stuff.
thanks,
mike

On Fri, Feb 26, 2010 at 10:35 PM, Emilie Laffray
wrote:

> On 26/02/2010 20:59, jamesmikedup...@googlemail.com wrote:
> > OK
> > I have updated the server here :
> > http://119.161.80.223:3000/Controller
> > It is running the lastest code.
> > You can see my demo controller, now I want to change the url of the
> > top frame based on the selection in the bottom one. I guess it might
> > be very easy.
> > there is a great plugin that just allows you to right click on
> > something and show it in a map.
> > the minimap plugin for firefox. Something like that is what I want.
> > but it would be great to be able to also select the location in the
> > map and update the lat /lon. Even to select a street and attach it
> > (data mode osm)
> >
> > this will be a great tool for osm, please help with it.
> > we can use it to create databases of addresses and pull them up in the
> > map, like select a street  and find all data rows with the street name
> > in it in that current town.
>
> You might want to check the parent functionality in Javascript. In the
> iframe, you may want to use code like this:
> var firstiframe = parent.getElementById("addresses");
> firstiframe.src = "http://www.mynewurl";;
>
> Please note that this code won't work on your current page as you have a
> name field instead of an id field, which is what getElementById is
> getting. Of course, you could use getElementsByName() but the
> compatibility is not as good. Please check the following page for more
> information:
> http://www.quirksmode.org/dom/w3c_core.html
>
> However, cross scripting prevention tools might balk at it.
> Also, for some reason, all files from openlayer are being loaded. YSlow
> is reporting the following:
> This page has 205 external Javascript scripts. Try combining them into one.
>
> The main openstreetmap site is using only 5 external javascript scripts,
> so you might want to investigate this for performance reason.
>
> Emilie Laffray
>
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-26 Thread Emilie Laffray
On 26/02/2010 20:59, jamesmikedup...@googlemail.com wrote:
> OK
> I have updated the server here :
> http://119.161.80.223:3000/Controller
> It is running the lastest code.
> You can see my demo controller, now I want to change the url of the
> top frame based on the selection in the bottom one. I guess it might
> be very easy.
> there is a great plugin that just allows you to right click on
> something and show it in a map.
> the minimap plugin for firefox. Something like that is what I want.
> but it would be great to be able to also select the location in the
> map and update the lat /lon. Even to select a street and attach it
> (data mode osm)
>
> this will be a great tool for osm, please help with it.
> we can use it to create databases of addresses and pull them up in the
> map, like select a street  and find all data rows with the street name
> in it in that current town.

You might want to check the parent functionality in Javascript. In the
iframe, you may want to use code like this:
var firstiframe = parent.getElementById("addresses");
firstiframe.src = "http://www.mynewurl";;

Please note that this code won't work on your current page as you have a
name field instead of an id field, which is what getElementById is
getting. Of course, you could use getElementsByName() but the
compatibility is not as good. Please check the following page for more
information:
http://www.quirksmode.org/dom/w3c_core.html

However, cross scripting prevention tools might balk at it.
Also, for some reason, all files from openlayer are being loaded. YSlow
is reporting the following:
This page has 205 external Javascript scripts. Try combining them into one.

The main openstreetmap site is using only 5 external javascript scripts,
so you might want to investigate this for performance reason.

Emilie Laffray



signature.asc
Description: OpenPGP digital signature
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-26 Thread jamesmikedup...@googlemail.com
OK
I have updated the server here :
http://119.161.80.223:3000/Controller
It is running the lastest code.
You can see my demo controller, now I want to change the url of the top
frame based on the selection in the bottom one. I guess it might be very
easy.
there is a great plugin that just allows you to right click on something and
show it in a map.
the minimap plugin for firefox. Something like that is what I want. but it
would be great to be able to also select the location in the map and update
the lat /lon. Even to select a street and attach it (data mode osm)

this will be a great tool for osm, please help with it.
we can use it to create databases of addresses and pull them up in the map,
like select a street  and find all data rows with the street name in it in
that current town.

thanks,
mike

On Wed, Feb 24, 2010 at 8:23 PM, jamesmikedup...@googlemail.com <
jamesmikedup...@googlemail.com> wrote:

> This is what I have so far, two iframes.
> The javascript was not working, I dont know why.
> here is my commit.
>
> http://github.com/h4ck3rm1k3/OAD-Open-Address-Database/commit/88b8624a45aee548e087f168409751f9951f4994
>
> Firebug for debugging. Yes I will put all the java script into the
> controller page, and install callbacks into the children pages.
> basically what I want is like this maps sidebar for firefox, but with the
> ability to look at tables of data for the find source.
>
> mike
>
>
>
> On Wed, Feb 24, 2010 at 7:06 PM, Emilie Laffray 
> wrote:
>
>> On 24/02/2010 16:03, jamesmikedup...@googlemail.com wrote:
>> > thank you!
>> > i will start with some greasemonkey to get going.
>> > thanks,
>> > mike
>> Grease Monkey might not be the best tool to perform javascript debugging
>> and general web debugging.
>> I would suggest firebug as a very good starting point. It will be more
>> efficient.
>>
>> Emilie Laffray
>>
>>
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread jamesmikedup...@googlemail.com
This is what I have so far, two iframes.
The javascript was not working, I dont know why.
here is my commit.
http://github.com/h4ck3rm1k3/OAD-Open-Address-Database/commit/88b8624a45aee548e087f168409751f9951f4994

Firebug for debugging. Yes I will put all the java script into the
controller page, and install callbacks into the children pages.
basically what I want is like this maps sidebar for firefox, but with the
ability to look at tables of data for the find source.

mike


On Wed, Feb 24, 2010 at 7:06 PM, Emilie Laffray wrote:

> On 24/02/2010 16:03, jamesmikedup...@googlemail.com wrote:
> > thank you!
> > i will start with some greasemonkey to get going.
> > thanks,
> > mike
> Grease Monkey might not be the best tool to perform javascript debugging
> and general web debugging.
> I would suggest firebug as a very good starting point. It will be more
> efficient.
>
> Emilie Laffray
>
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread Emilie Laffray
On 24/02/2010 16:03, jamesmikedup...@googlemail.com wrote:
> thank you!
> i will start with some greasemonkey to get going.
> thanks,
> mike
Grease Monkey might not be the best tool to perform javascript debugging
and general web debugging.
I would suggest firebug as a very good starting point. It will be more
efficient.

Emilie Laffray



signature.asc
Description: OpenPGP digital signature
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread jamesmikedup...@googlemail.com
thank you!

On Wed, Feb 24, 2010 at 5:10 PM, Nick Whitelegg  wrote:

> >Another cleaner option is to use all that AJAX magic stuff to load the
> >content in a  rather than in an .
>
> >May I suggest you the "ajax for dummies" book? It's a nice hands-on
> >introduction to this javascript stuff.
>
> AJAX is easy. ;-)
> Particularly if you use prototype (www.prototypejs.org). I don't think
> I've needed to use an iframe in my life. :-)
>
> See, for example (absolute bare-bones example, you have to enter one of
> the three specified destinations and "010708" for the date):
>
> http://www.free-map.org.uk/course/ajaxexample.html
>
> The javascript queries the server with what the user entered in the 2 text
> fields, the server sends a load of text back and loads it into a specified
> .
>
> Nick
>
> ___
> dev mailing list
> dev@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread Nick Whitelegg
>The javascript queries the server with what the user entered in the 2 
text fields, the server sends a load of >text back and loads it into a 
specified .

Oops - meant to say "the JavaScript loads the text into the specified 
".

Nick

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread Nick Whitelegg
>Another cleaner option is to use all that AJAX magic stuff to load the 
>content in a  rather than in an .

>May I suggest you the "ajax for dummies" book? It's a nice hands-on 
>introduction to this javascript stuff.

AJAX is easy. ;-)
Particularly if you use prototype (www.prototypejs.org). I don't think 
I've needed to use an iframe in my life. :-)

See, for example (absolute bare-bones example, you have to enter one of 
the three specified destinations and "010708" for the date):

http://www.free-map.org.uk/course/ajaxexample.html

The javascript queries the server with what the user entered in the 2 text 
fields, the server sends a load of text back and loads it into a specified 
.

Nick

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread jamesmikedup...@googlemail.com
thank you!
i will start with some greasemonkey to get going.
thanks,
mike

2010/2/24 Iván Sánchez Ortega 

> El 24/02/2010 15:25, jamesmikedup...@googlemail.com escribió:
>
>  Hi all, I am not a real javascript developer, can you give me some
>> advice on this ;
>>
> [...]
>
>  How can I connect two windows to each other, I would like to call a
>> different url in what would its own sub window. so when you click on
>> a text field, and right click on it, select find, it will then
>> refresh the lower map window.
>>
>
> Sounds like you want to use iframes*. Simply put a  id='foo'> somewhere, and that'll be your "sub-window". In order for
> it to load a URL, you just do
> document.getElementById('foo').src='url_goes_here'; in javascript.
>
> * IFrames are evil. Yes, even more evil than FakeSteveC.
>
> Another cleaner option is to use all that AJAX magic stuff to load the
> content in a  rather than in an .
>
> May I suggest you the "ajax for dummies" book? It's a nice hands-on
> introduction to this javascript stuff.
>
>
> Cheers,
> --
> Iván Sánchez Ortega 
>
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] need some javascript help

2010-02-24 Thread Iván Sánchez Ortega
El 24/02/2010 15:25, jamesmikedup...@googlemail.com escribió:
> Hi all, I am not a real javascript developer, can you give me some
> advice on this ;
[...]
> How can I connect two windows to each other, I would like to call a
> different url in what would its own sub window. so when you click on
> a text field, and right click on it, select find, it will then
> refresh the lower map window.

Sounds like you want to use iframes*. Simply put a  somewhere, and that'll be your "sub-window". In order 
for it to load a URL, you just do 
document.getElementById('foo').src='url_goes_here'; in javascript.

* IFrames are evil. Yes, even more evil than FakeSteveC.

Another cleaner option is to use all that AJAX magic stuff to load the 
content in a  rather than in an .

May I suggest you the "ajax for dummies" book? It's a nice hands-on 
introduction to this javascript stuff.


Cheers,
-- 
Iván Sánchez Ortega 

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


[OSM-dev] need some javascript help

2010-02-24 Thread jamesmikedup...@googlemail.com
Hi all,
I am not a real javascript developer, can you give me some advice on this ;

1. I have a url that will return the map for a location string
2. I have a browser for a database browser.

How can I connect two windows to each other, I would like to call a
different url in what would its own sub window.
so when you click on a text field, and right click on it, select find, it
will then refresh the lower map window.

does anyone have some java script for this or whant to help?
the project is the openaddressdatabase, which uses a generic automatic
database table format using the autocrud lib,
that generates a nice table with browse and filter for any database.

I want to extend this autocrud with a set of menus to search geonames and
display it on the map below.

what do you think? how to do this best.

mike
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev