Google Maps integration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Google Maps integration

admin Yellowikis
I've been trying to find a way to use Google Maps API to allow users
to identify the latitude and longitude of a business and then add it
to Yellowikis.

I asked a Google Maps "guru" about this idea and he told me:

"There's a fundamental problem trying to integrate Wikis, Google Maps and
Internet Explorer. If you can find a way past this one hurdle, then the
rest should be straight forward.

The problem is that IE refuses to allow Google Map API Javascript to be
placed inside a <div> or a <table>. Nobody really knows why, it's just
one of many bits of strange behaviour exhibited by IE. Wiki's don't like
pages to have custom content that's outside the "editsection" <div>.

The API code would like it to be possible to have a chunk of Javascript
that sits between these two lines
<!-- Served by truth in 0.14 secs. -->
</body>
(The map itself would appear in a "map" <div> within the "editsection"
<div>, it's just the associated Javascript code that must be moved.)
My understanding is that it's not easy for a Wiki page to contain custom
content there.

Possible workrounds are:

(1) Serve the map in an off-Wiki page within www.yellowikis.org. Write
the external page so that it looks something like a Wiki page. It might
then be tricky to get the user back to the Wiki page that he came from
in order to do something with the geocoded information.

(2) Serve the map in an <iframe>. Will a Wiki allow an <iframe> within
the "editsection"?


Here's a possible strategy:

A "create listing using a map" link takes the user to an off-Wikki page
www.yellowikis.org/map/map.html. The user sees a map of the world and a
set of instructions.

User zooms and pans until happy with the location, then clicks a button
that initiates the recording process. Once that button has been clicked,
a form is displayed at the side of the map, in which the user can enter
basic details like the company name, contact details and classification
codes. Clicking on the map in "record" mode causes a marker to be
displayed and the latitude and longitude to be inserted into the form.
Clicking on the map moves the marker and inserts the new latitude and
longitude into the form.

Clicking on the "Submit" button causes a few simple checks to be
performed (are the mandatory fields present?) then submits the data to
your server.

Somehow your server has to convert a wodge of data into something that's
suitable for the "editsection" of a Wiki page. Create the page if it's
not there already. Replace the stub contents if there's a stub. Do
something sensible if there already is a real entry. (You're on your own
with this section of the processing. I know nothing about PHP or the
server-side internals of wikis.)

Control then passes back to a page within the Wiki that tells the user
that the data has been accepted."

Does anyone have any thoughts on this?

Will I have to make an extension?

FYI Yellowikisis running:
    *  MediaWiki: 1.5.5
    * PHP: 4.4.2-0.dotdeb.1 (apache)
    * MySQL: 5.0-Debian_4sarge2-log

    * Extensions:
          o Parser hooks:
                + Inputbox by Erik Moeller
          o Extension functions:
                + registerInputboxExtension

Any advice would be welcome.

Paul
--
Yellowikis is to Yellow Pages, as Wikipedia is to The Encyclopedia Britannica
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps integration

Daniel Schwen-2
> "There's a fundamental problem trying to integrate Wikis, Google Maps and
> Internet Explorer. If you can find a way past this one hurdle, then the
> rest should be straight forward.

Uhm, but there are serveral Google Maps extensions, and at least one of them
(http://www.schwen.de/wiki/GMap) works hapily in IE (6.0).

--
http://en.wikipedia.org/wiki/User:Dschwen
http://de.wikipedia.org/wiki/User:Dschwen
http://commons.wikipedia.org/wiki/User:Dschwen
http://meta.wikipedia.org/wiki/User:Dschwen
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps integration

Ilmari Karonen
In reply to this post by admin Yellowikis
admin Yellowikis wrote:
>
> The API code would like it to be possible to have a chunk of Javascript
> that sits between these two lines
> <!-- Served by truth in 0.14 secs. -->
> </body>
> (The map itself would appear in a "map" <div> within the "editsection"
> <div>, it's just the associated Javascript code that must be moved.)
> My understanding is that it's not easy for a Wiki page to contain custom
> content there.

I don't know anything about Google Maps, but if all you need is a chunk
of HTML added just before the end of the <BODY>, an easy way to do it
would be to append it in an onload handler, something like this:

   addOnloadHook(function () {
      document.getElementsByTagName('body')[0].innerHTML +=
          "YOUR HTML CODE GOES HERE";
   });

That said, if the code you're trying to add is itself Javascript, why
can't you just place it directly in one of the JS files included in the
<HEAD> section?

--
Ilmari Karonen
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps integration

admin Yellowikis
In reply to this post by Daniel Schwen-2
I hadn't see that before - very nice.

Paul



On 3/2/06, Dschwen <[hidden email]> wrote:

> > "There's a fundamental problem trying to integrate Wikis, Google Maps and
> > Internet Explorer. If you can find a way past this one hurdle, then the
> > rest should be straight forward.
>
> Uhm, but there are serveral Google Maps extensions, and at least one of them
> (http://www.schwen.de/wiki/GMap) works hapily in IE (6.0).
>
> --
> http://en.wikipedia.org/wiki/User:Dschwen
> http://de.wikipedia.org/wiki/User:Dschwen
> http://commons.wikipedia.org/wiki/User:Dschwen
> http://meta.wikipedia.org/wiki/User:Dschwen
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/wikitech-l
>


--
Yellowikis is to Yellow Pages, as Wikipedia is to The Encyclopedia Britannica
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l