We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29774
    • 386 Posts
    This is an auto-generated support/comment thread for GoogleMap.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Outputs one or multiple Google maps using on-the-fly accurate geocoding of addresses or predefined points

    Latest release - 19 September 2008
    GoogleMap 1.3.2
      Snippets: GoogleMap | FileDetails | Related Plugin: SSL
      • 31654
      • 238 Posts
      Hi, how do you set the zoom?... Do I use 75%?... I guess not!

      The default map is zoomed in too much so I need it to zoom out.. some how!
        Web Development, Web Hosting & Search Engine Marketing by:

        Vitalized | UK
        w. www.vitalized.co.uk

        Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

        Vitalized | Australia
        w. www.vitalized-australia.com.au

        Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
        • 2472
        • 151 Posts
        Hi there,

        the map object has a setZoom method, look it up in the GoogleMaps documentation...

          A thing of beauty is a joy forever ( John Keats)
          • 31654
          • 238 Posts
          I needed to know the call in the snipet but I found out it was my ’ ’ marks that were wrong... All sorted now, for these that want to change the default zoom level use
          &zoom=`15`
            Web Development, Web Hosting & Search Engine Marketing by:

            Vitalized | UK
            w. www.vitalized.co.uk

            Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

            Vitalized | Australia
            w. www.vitalized-australia.com.au

            Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
            • 16919
            • 18 Posts
            Hi,

            I would want to know how modify the snippet to make bubble marker closed by default.
            I’ve tried this :

            $gmapjs .= ’
            map.addOverlay(marker);
            //marker.openInfoWindowHtml(myMarkerContent); <- modification here
            GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(myMarkerContent);
            });
            }
            createMarker(new GPoint(’.$coord[0].’,’.$coord[1].’));
            }
            }

            The bubble marker is now closed when you load the google map but the map is not centered any more on my marker ...

            Any idea ?

            Thanks
              • 14431
              • 65 Posts
              Any idea how easy / hard it would be to replace the map with this?
              http://www.google.com/uds/solutions/wizards/mapsearch.html
              Thanks,
              joe
                • 21056
                • 327 Posts
                There’s a little glitch if you are including the bubble content from a chunk, and it includes html with attributes or line breaks, since these interfere with the quoting of the javascript.

                Replace
                if (strlen($bubbletpl)) {
                      $gmapjs .= 'var myMarkerContent = "'.$modx->getChunk($bubbletpl).'";';
                }
                

                with
                if (strlen($bubbletpl)) {
                      $js_safe_chunk= str_replace("\n", "", $modx->getChunk($bubbletpl));
                      $js_safe_chunk= str_replace("\r", "", $js_safe_chunk);
                      $js_safe_chunk= addslashes($js_safe_chunk);
                      $gmapjs .= 'var myMarkerContent = "'.$js_safe_chunk.'";';
                }
                

                (this could be neatened slightly, but it is split over 3 lines to make it read more easily.
                  Author: ManagerManager plugin - customise your ModX manager interface

                  Rckt - web development, Sheffield, UK
                  • 2762
                  • 1,198 Posts
                  Using &address parameter, a lot of maps created have markers, in a wrong street and sometimes in a wrong town or state laugh

                  searching the same address on the google map site, works fine.
                    Free MODx Graphic resources and Templates www.tattoocms.it
                    -----------------------------------------------------

                    MODx IT  www.modx.it
                    -----------------------------------------------------

                    bubuna.com - Web & Multimedia Design
                    • 8471
                    • 333 Posts
                    Hi, when I try to call 2 maps on the same page I receive this error:
                    Fatal error: Cannot redeclare geocode() (previously declared in C:\sito\manager\includes\document.parser.class.inc.php(748) : eval()'d code:181) in C:\sito\manager\includes\document.parser.class.inc.php(748) : eval()'d code on line 192
                    

                    If I call only one map everything works fine
                      Sorry for my bad English grin
                      • 29774
                      • 386 Posts
                      Try checking that the function exists before declaring it like this (lines 181-191):
                       if (!function_exists('geocode')) {
                      	function geocode($postcode) {	
                      		$postcode = urlencode($postcode);
                      		$coord = array();	
                      		// The URL of google to append the postcode
                         	 	$url = "http://maps.google.com/maps?output=kml&q=";
                      		$haystack = file_get_contents($url.$postcode);
                      		$start = strpos($haystack, '<coordinates>') + 13;
                      		$end = strpos($haystack, '</coordinates>');
                      		$coords = substr($haystack, $start, ($end-$start));
                      		$coord = explode(",", $coords);	
                      		return $coord;
                      	}
                      }
                      
                        Snippets: GoogleMap | FileDetails | Related Plugin: SSL