[OSM-dev] need some javascript help

Emilie Laffray emilie.laffray at gmail.com
Fri Feb 26 21:35:26 GMT 2010

On 26/02/2010 20:59, jamesmikedupont at googlemail.com wrote:
> OK
> I have updated the server here :
> 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

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100226/741e9800/attachment.pgp>

More information about the dev mailing list