Log in

Pedro Prez

elgg developer / php / ajax and more


  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2010-2-2
  • Downloads: 3675
  • Recommendations: 27


Previous releases:

Other Projects

View Pedro Prez's plugins

Geolocation for Elgg 1.6

allows you to geoposicionate every object/user/group on elgg

Last updated 1544 days ago

This plugin allows you to geoposicionate every object/user/group on elgg.

You will not need to install another plugin to make it works, you just have to enable it like another normal plugin.

-The possibility of geopositionate the groups and any elgg object.
-If a group or an object is not geopositionated then that object is going to take the user owner possition.

Here some more information about it:


    * Unzip the file to the elgg/mods/ directory.
    * Go to your Elgg tools administration section, find the new tool, and
      enable it.     
    * Get an API key from Google Map (if you don't have one) http://code.google.com/apis/maps/signup.html
      * Enter the API key on the administration tools plugin settings.  
    * Enjoy.

    * The plugin is enable by default for users and groups, but to make it work in objects (files, blogposts, pages)
      there is something else to do, we have to:
          * On "start.php" under "geolocation_pagesetup" function, then will look for $allowed_contexts and we add to
              the array the context where we will add, edit, and show the objects.
              As an example, for the file plugin we add, edit and show the objects on the same context, file.
          * This is an example to show up how to modify a view file from the file plugin, this will enable the geolocalization of object furthermore than getting the owners geolocalization.
          //Show the map for geotagging
        if (isset($vars['entity'])) {
            $entity = $vars['entity'];
        $form_body .= "<p>";
        $form_body .= "<label>" . elgg_echo('location') . "</label>";
        $form_body .= elgg_view('input/geomap', array(
            'value' => $location,
            'classname' => 'register_map',
            'entity' => $entity
        $form_body .= "</p>";
        echo $form_body;
        *This is to draw the map on the object view.
        echo "<p>" . elgg_echo('location') . "<p>";
        echo elgg_view('output/geomap', array('value' => $location, 'entity' => $file));
** TODO **
    * Profile manager support.
    * Site access support.


v0.1b (2010-01-29)
    * First beta release.


  • Nikolas Dovrolis 1544 days ago

    Looks good m8. Will give it a spin

  • Nikolas Dovrolis 1544 days ago

    Ok i have tried it on 1.6.1 both with profile manager plugin on and off. When it is off things work as they should.

    When i turn it on though it is a different matter since this plugin doesn't show the maps in profiles anymore.So it got me thinking.Could we geotag the avatar / profile picture in profile?That way we could have both the custom fields and geotagging. Is there an easier way or should i try to work something on that ?


  • Mike Zacher (vazco) 1544 days ago

    Pedro, I just uploaded a new version of vazco_gmap plugin that has a quite similar functionalities to your plugin, it's available here. It has support for profile manager and forms plugin (and is dependant on them, so offers something a bit different than your plugin)

  • Alex 1544 days ago

    Nice plugin, but  not working with site_access plugin.   ;-(   

  • martinez 1543 days ago

    Well vazco, dont forget your pugin is paid, so let people try it out. We all need good geolocation for free...

  • Mike Zacher (vazco) 1543 days ago

    Martinez, the vazco_gmap plugin offers all geolocation functions for free in GPL version. The paid version is required only when you want to use the map of entities and additional functionalities.

  • Lawrence 1542 days ago

    @Pedro: I tried editing the start.php to add another plugin to the array and got this error message:

    [a fatal error or timeout occurred while processing this directive]


  • Pedro Prez 1540 days ago

    Hello all, sorry for the delay of this replay:
    @Nikolas Dovrolis profile manager issue, well this is something that must be done (profile manager support) so I will put it to the todo list.

    @Alex the same for the site access plugin.

    @Lawrence and about it, mmm.. I searched that message into elgg and I didnt find it, I think it is a php error and not a elgg error.

    Regards and thanks for your comments.

  • Pedro Prez 1540 days ago

    I also would like you comment which features or functionalities you would like this plugin has.


  • justme 1532 days ago

    hi pedro!

    is it possible to geoposicionate only users (and not groups?)

  • Pedro Prez 1532 days ago

    Hello @oma,

    Yes it is possible, you have to modificate the start.php. In a future version you would be able to select what to geoposicionate ;)

    Thanks for you comment.

  • bernardo 1522 days ago

    I'm having trouble with this module, I'm Elgg version 1.6.1

    Soon after activating the module, and state my key googple map, if I try to register new users to the page is blank.
    Page: / account / register.php

    Nor can create new groups of users page is also blank.

    Will have settings to do?

  • moot 1522 days ago

    Great work. Have you considered using MySQL built in GIS capabilities? See http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

    It would require another table that includes the GUID and the geometry. However, it would allow to have much more powerful query, such as find objects related to points within a given area.


    fieldtypedescriptionguidBIGINT(20) UNSIGNEDthe id from the entities tablegeomGEOMETRYthe geometry


  • Tom 1521 days ago

    Indeed in 1.6.1 it breaks the creation of new groups

  • fizzler 1520 days ago

    I have a problem.  In profile page do not display map. Only text: 'Output map' Any ideas?

  • Pedro Prez 1520 days ago

    @bernardo Did you try it in a out of the box elgg installation? or did you try with a site that already have maybe you can start desabling the modules to know if the problem is with the geolocation module or with another module. 

    @Tom I will check it out.

    @moot when I have some time I will take a look.

    @fizzler maybe your problem is with the google maps API Key, did you check it?

    Thanks a lot for your comments.


  • emdagon 1509 days ago

    Hi Pedro, I just installed your plugin in a fresh Elgg 1.7 and I got a "Error reading XML" when I go to edit profile.  It's this a support issue?


  • aufreise 1270 days ago

    Hi Pedro,

    I have your Plugin running on a fresh 1.7.4 - works perfectly! Thank you for the good work!

    Best regards,


  • jckm2000 1173 days ago

    Installed ok but only shows map on the 'inside' the profile (edit profile) but not on the outside (public) of the profile.

    Also adds a location field to signup form, conflicts with captcha.

  • Don Robertson 1167 days ago

    @Nikolas Dovrolis profile manager issue, well this is something that must be done (profile manager support) so I will put it to the todo list.

    Hi - I have made the Profile Manager the first entry in the tools list, and this *seems* to have fixed the conflict with the Geolocation module. My Geolocation module is second from the bottom of the list.

    ANyway - how would I either not tag things, or let people tag as New Zealand, or World, and have a higher altitude view for the map? 

  • martinez 1142 days ago

    Hi pedro, when you ll have time to develop the new version? the profile manager issue doesn t let many people use yur great plugin. By the way has anyone fix it by himself?

  • joriga 1068 days ago

    Hi Pedro :)

    I did get work more or lest the map on profile manager with: 

    Adding :

     if (isset($vars['entity'])) {

                $entity = $vars['entity'];


            $form_body .= "<p>";

            $form_body .= "<label>" . elgg_echo('location') . "</label>";

            $form_body .= elgg_view('input/geomap', array(

                'value' => $location,

                'classname' => 'register_map',

                'entity' => $entity


            $form_body .= "</p>";

            echo $form_body;

    on profile_manager/views/default/profile/edit.php line 300

    and show me the form map on edit profile and show the map on profile, but i dont get user location yet :s

    some help?

  • zenin 919 days ago

    please help me in converting this plugin so that it works on Elgg 1.8.

  • blasto 553 days ago

    Iepa Pedro! Estoy como @zenin deseando la versión para 1.8.8

    Llevo 2 dias en esto de elgg, han sido infinidad de problemas, reinstalaciones, poco sueño...
    Si estás desarrollandola para esta versión, te lo agradezco, sino sugiero ayuda para hacerlo yo.



    Hi Pedro! I'm like zenin, waitting for the 1.8.8 version.

    I am only for 2 days here, and it has been very problematic. If you are developing it, thanks, else i need help to make it.