google maps plugin

72 views
Skip to first unread message

Juan Simon Rico Jimenez

unread,
Nov 17, 2014, 8:36:39 PM11/17/14
to hippo-c...@googlegroups.com
does anyone know about a Google maps plug in for hippo? i want to add a map to a document so the document can be associated to a location

Tobias Jeger

unread,
Nov 18, 2014, 2:59:11 AM11/18/14
to hippo-c...@googlegroups.com
nope, but I remember a project where we defined a compound to keep the coordinates of a location. During rendering of a page, these coordinates would be used to produce Javascript that generated the Google map pointing to the desired location.

cheers

Tobi

On Tue, Nov 18, 2014 at 2:36 AM, Juan Simon Rico Jimenez <sir...@gmail.com> wrote:
does anyone know about a Google maps plug in for hippo? i want to add a map to a document so the document can be associated to a location

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Jeroen Reijn

unread,
Nov 18, 2014, 3:45:22 AM11/18/14
to hippo-c...@googlegroups.com
Hi Juan,

Tobias his solution is probably the easiest. I've also seen several Google Maps plugins while I was at customers. Not sure if any of the developers are reading this, but it would be great if you could share these with the community. I know there is one plugin on Github, which is a little outdated, but other then that I'm not aware of one you could use.

Jeroen
Jeroen Reijn
Hippo


Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

marijan milicevic

unread,
Nov 18, 2014, 4:36:26 AM11/18/14
to hippo-c...@googlegroups.com
Hi Juan,

On Tue, Nov 18, 2014 at 9:45 AM, Jeroen Reijn <j.r...@onehippo.com> wrote:
Hi Juan,

Tobias his solution is probably the easiest. I've also seen several Google Maps plugins while I was at customers. Not sure if any of the developers are reading this, but it would be great if you could share these with the community. I know there is one plugin on Github, which is a little outdated, but other then that I'm not aware of one you could use.

Jeroen


if you are on 7.8.xx version you could use one of these:


The later one is rich editor plugin and only displays an static image. To make it load full map, you'll need some javascript, see an example below,
cheers
marijan


JS example:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript">
            //  <![CDATA[
            var GOOGLE_MAP_OPTIONS;
            function setupMaps() {
                GOOGLE_MAP_OPTIONS = {
                    zoom: 20,
                    center: new google.maps.LatLng(-33, 151),
                    disableDefaultUI: true,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    navigationControl: true,
                    scaleControl: true
                };
                var maps = $(document).getElements('img[src^=http://maps.google.com/maps/api/staticmap]');

                $each(maps, function(img, idx) {
                    var mapCounter = 0;
                    var idPrefix = "agm_";
                    var height = img.get('height');
                    var width = img.get('width');
                    var id = idPrefix + mapCounter++;
                    var owner = img.getParent();                    
                    var div = new Element('div', {id:id, style:'background-image:url(' + img.get('src') + '); height:' + height + 'px; width:' + width + 'px;'});
                    div.wraps(img);
                    owner.adopt(div);
                    //img.wrap(div);
                    var lat_lng = img.get('alt');
                    lat_lng = lat_lng.split(',');
                    var lat = lat_lng[0];
                    var lng = lat_lng[1];
                    GOOGLE_MAP_OPTIONS.center = new google.maps.LatLng(lat, lng);
                    var map = new google.maps.Map(document.getElementById(id), GOOGLE_MAP_OPTIONS);
                    // add marker:
                    var marker = new google.maps.Marker({
                        position: GOOGLE_MAP_OPTIONS.center,
                        map: map
                    });
                });
            }
            window.addEvent("domready", setupMaps);
            //]]>
        </script>

Minos Chatzidakis

unread,
Nov 18, 2014, 5:47:46 AM11/18/14
to hippo-c...@googlegroups.com
Hi Juan,

Did you perhaps run a search in our forge? [1]
There are 3 maps plugins there, I know that at least one of them loads a map into your document.

But please beware, these are really old plugins! I guess that's why none of my colleagues suggested them to you. 
Nevertheless, you may find useful bits in them, surely though they're incompatible with current Hippo versions (the plugins are 4 and 5 years old).

Best bet would be to see the one Marijan mentioned, or go with Tobias approach.


Minos
--
With kind regards/Met vriendelijke groet,
Minos Chatzidakis
Reply all
Reply to author
Forward
0 new messages