Forum OpenACS Development: Re: New package: MAPS (Google Maps integration)

Collapse
Posted by Eduardo Santos on
Hi everyone,

We have a provisory documentation at the address http://www.softwarepublico.gov.br/dotlrn/clubs/openacs/xowiki/en/pacote-maps.

Feel free to post here if you have any doubts.

Collapse
Posted by Malte Sussdorff on
Hi Eduardo, this sounds really promising. I don't know when I will get around to it (I already got sidetracked from the video integration I wanted to do ....), but I would love to integrate this with intranet-contacts and intranet-core so you can see the location of your contacts (both company and individuals) based on the location.

Am I right in the assumption that this is what the package wants to do, because from looking at the documentation and the callback I sadly could not for the life of it figure out how you get the map information :). But maybe I should have looked at the sourcecode as well ....

Collapse
Posted by Eduardo Santos on
Hi Malte,

Sorry. We have a lack of documentation that should be solved soon.

The map information is really a tricky thing, but it's not hard to understand. The map is based in two objects: maps and position. Avery time you create a package instance, a new map is created, and this map can have as many positions as you want.

The package is designed to think that you are going to mount the map somewhere and include it in another place. Let's say that you you mount it under /maps: a new map_id will be created for this instance. You are going to include this map_id in any other you want to.

So, what you have to do is:

1 - Create the callback for your object_type. It's pretty simple: it should only supply some info that is specific for this object and we use it when we are maping. I guess this part of documentation is OK.

2 - Include the page /maps/lib/position-view with the maping object_id, return_url and map_id (we have to find a better way to discover this map_id) in the page that you edit the object information. In organizations package, for example, the information page should be organizations/www/one and object_id should be organization_id. This page will show the object's individual position.

3 - Include the page /maps/lib/map-view supplying the map_id (again, there must be a clever way to do it) and you can see all the positions in this map.

I recommend you to run a svn export right now, because we have done a lot of improvements in the last few hours. Let me know if there's any other thing you want to know, so we can put it back in the documentation.

I hope it's useful. :)