Path

ez.no / developer / contribs / datatypes / google maps location datatype


Google Maps Location Datatype

Author Version Downloads Compatible with
Joe Kepley 0.4 1298 3.8+
This datatype allows the storage of latitude/longitude values. Editing is integrated with Google Maps for ease of use.

This extension has been moved to http://projects.ez.no/googlemaps
(A newer version for eZ Publish 4.0 and 4.1 can be found in svn)

Description

This extension provides the GMaps Location datatype, which allows you to easily enter Latitude/Longitude data into eZ Publish using Google Maps as an entry method.

The system allows users to quickly search for a point by specifying an address, intersection, city, state, or zip, then refine that search by clicking points on the map.

Also included are sample files for creating templates to use Google Maps to display lat/lon data on the site.

Possible uses: Location maps, photo tours, position tracking, etc.

NOTE: There are additional steps required to installing the extension beyond just uploading it and activating it in the admin. Please read the readme.txt for full instructions.

Screenshot

google maps location datatype extension for eZ Publish
google maps location datatype extension for eZ Publish

Changelog

Version 0.4
-------------------------------------------------------------------------------
* Resolved a few warnings and error messages.

* Much simpler install - modified the javascript so that no template changes
are required in the admin design.

* The editing controls will now work properly if there are multiple location
attributes on a single object.

* In the editing view, the map will now re-center on the clicked point. This
makes it easier to use the click-point and zoome controls to hone in on a
specific point.

* The edit map now defaults to a zoom-level-0 view of the globe instead of
a gray square.

* The edit map is larger, so that the map type and directional controls don't
overlap.

* A new template has been included, gmap.tpl. This is a multi-purpose template
that can be included and configured to handle several common use-cases for
the gmaps datatype. See the doc on the template for specifics.

Version 0.3 - Initial Release
-------------------------------------------------------------------------------

Comments

Re: Compatibility with ez 4.1

Compatibility with ez 4.1

The new version 0.5 it's compatible with ez 4.1.3? I have try this extension with my ez 4.1 but I don't see any new gmaplocation datatype available in datatype list on class edit.

Looking for updated Google Maps solution with eZ Publish 4.x compat out of the box, try this ...

Hello,

I recently tried to use (just recently updated to recommend projects svn copy of) this google maps location datatype.

I had some concerns about the compatibility (with eZ Publish 4.1+) and all around functionality of the extension as currently available in the extension.

I noted it had been a while since even a ez community member contributed additional 4.0 compatibility or new features to the extension. [1]

A customer of ours required additional google maps functionality.

Our needs included a more reliable location datatype attribute edit gui template (for more accurate location lookup), display content objects in a folder template and settings to store and consume the Google Maps API within eZ Publish.

Unable to reach the previous contributors we have published our extension for your review. Please let us know how this finds you. Well we hope :)

The BC Gmaps Location extension provides an upgraded, updated, tested, proven modified copy of this extension's functionality extended to offer additional example location map templates to help you get started quickly. [0]

Cheers,
Heath

[0] http://projects.ez.no/bcgmapslocation
[1] http://projects.ez.no/googlemaps/subversion/4

Problem with eZ Publish 4.1

Hi,
I have installed eZ Publish 4.1 and tried to use Google Maps Extension 4 with it. Unfortunatelly errors occured. Can you solve this problem?

Fatal error: Class 'eZDOMDocument' not found in \WWW\extension\gmaplocation\datatypes\ezgmaplocation\ezgmaplocation.php on line 116
Fatal error: eZ Publish did not finish its request

It seems to me that eZDOMDocument class is missing. How to resolve this?




  function &xmlString( )


  {


      include_once( 'lib/ezxml/classes/ezdomdocument.php' );


#116:     $doc = new eZDOMDocument( "Location" );


      $root = $doc->createElementNode( "ezgmaplocation" );


      $root->appendAttribute( $doc->createAttributeNode( "latitude", $this->Latitude ) );


      $root->appendAttribute( $doc->createAttributeNode( "longitude", $this->Longitude ) );


      $doc->setRoot( $root );


      $xml = $doc->toString();


      return $xml;


  }





This is when I saved the new Map class with a new attribute "GMaps Location".
Thank you for your help
Mariusz.

Link for 0.4 version

See the SVN repository:

http://websvn.projects.ez.no/wsvn...tension/gmaplocation/?rev=3&sc=1

There is also a link to the newer version 0.5, for eZ 4

Link for 0.4 version

Hi,

I'm interessed too for a link to 0.4 version !

version 0.4

Does anyone has a download link for the 0.4 ?
Thanks

Out-of-date version

The version which can be downloaded off ez.no is apparently still 0.3, with files dating 2006/10/18.
And the link to download on the blendinteractive.com website returns a 'kernel error' page.

Besides the link to the google map js not using the up-to-date version, a php warning will be generated on line 100 of ezgmaplocation.php - just comment it out.

Javascript Error

UPDATE: I found this on Google: http://groups.google.com/group/Go...ad/4bbfd391df82f378/6e1a58fccd14ff86

The fix is changing the version from 2.x (which grabs the latest version of the Google API) to 2.s in design\..\override\templates\full\page_name.tpl. That fixed the problem!

----
I have a site that I am working on that is using your extension. The map was working great before, but now when I load the page with the map I get an javascript error('_mMapError is not defined'). I debugged this from IE with a script editor and the error that is getting thrown from Google's code is 'ia.prototype.getProjection=function(){return this.Ze};' (from http://www.google.com/intl/en_us/mapfiles/85/maps2.api/main.js, line 36)

Here is the javascript call (from the page source) that is creating the GMapType.



var custommap = new GMapType(tilelayers, G_SATELLITE_MAP.getProjection(), "SiteName",{errorMessage:_mMapError});




Thank you.

Enhanced edit interface

Thanks for this nice contribution.

I have enhanced the edit interface to make the marker dragable for fine-tuning the position. As this extension is not in the repository, drop me a line if you are interested ( info at webmanufaktur dot ch ).

Regards, Donat Fritschy

Some remarks / enhancement requests

Hi Joe

Still a great extension, we're using it on eZpedia in the user profile, you can see the overview at http://ezpedia.org/wiki/en/users ;-)

There are temporary/backup files (ending on ~) in the zip file you provide, can you remove them before zipping the extension?

I'd also like to suggest to have a parameters set on class attribute level for the start point and zoom level, these can be used when latitude and longitude are not filled in yet. Currently the map starts at zoom level 13 somewhere in the ocean :-D

Also parameters for the width and height of the map in the edit interface would be nice, but this can be done too with CSS. The hardcoded values are way too less to be able to get an overview and put the marker on the right place.

New Version 0.4

Here's a new release that addresses a few bugs and makes a few tweaks to the editor. The major changes:

-- Installing the datatype no longer requires any sort of modification to the default admin templates. The javascript problem that required this has been worked around.

-- You can now have multiple instances of the attribute on the same object without causing editor problems.

-- A new template, gmap.tpl has been included that makes it very easy to do basic mapping.

-- Enhancements have been added to support and work with Blend's new Location Finder extension, which allows you to geocode your eZ Publish objects and search them geographically. This makes it easy to add things like a 'find the nearest store' app to your eZ site. You can find the Location Finder extension here:

http://ez.no/community/contribs/applications/location_finder

Suggestion: Use the forum ...

It's great to see so many people interested
in discussing the internals and use of this contribution.

I would add just one suggestion, which is
to create a 'Developer' forum (thread) for
discussions surrounding this contribution.

It makes for clear contribution information,
leaves comments for positive references
or ratings and uses forums for continuing
active discussions.

cheers,
//kracker

KMK - Bring it On

Add caption in Gmarker

Hi,

How can i add the caption attribute to add it in Gmarker in the script ?
@+

Ok for all but ...

Hi,

Now it's ok for all, front end and back end. My problem was that the name of the attribute is "localisation" and not "location". Now the map appear in the site but in the back end i have google maps with map or satellite view or mixte but not in the front end, why ???
@+

Ok for override but ?

Thanks,

Now, i want to have the same demo that in your site. I see your samples (in samples folder). How can i have, icons and text in the maps, where is done the text ?

Template editing

Since everyone will have different uses for the data, the extension doesn't automatically install anything to the front end. You need to decide how you'd like your maps to appear, and make custom edits to your templates to use the location data.

Continuing the image example, the simplest way to add a map would be to edit the override/full/image.tpl for your design and add something like this:
{attribute_view_gui attribute=$node.object.data_map.location}

After clearing the cache, that would give you a small gmap displaying your point.

Ok for the backend but for the frontend ?

Hi,

thank's for your answer, it's great for the backend, i can see google maps with my position, but when i see this image on the frontend site i see nothing, the map don't appear ????
@+

Editing a Class

Pascal, sorry, I don't have anything written on how to use the class editor, but here are a couple of articles that may help:
http://ez.no/doc/ez_publish/techn...content_management/the_content_class
http://ez.no/products/ez_publish/...on/content_structure/content_classes

The easiest way to see the datatype in action would be to edit an existing class. Let's say you wanted to add a location field to the image class so that you can mark where all of your images were taken. You would:

- Click the 'Classes' link on the 'Setup' tab.
- Click the 'Media' class group
- Find the 'Image' class, and click 'Edit'
- At the dropdown on the bottom, select 'Gmaps Location' and hit the 'Add Attribute' button.
- Give your new attribute a name (like 'Location') and an identifier (like 'location')
- Click OK.
- Now, go back to your content structure and create a new image. You should see your new location attribute in the editor that comes up.

Hope that's helpful

install a class

Hi,

i have make what you say in your redme.txt, but i don't understand how add a class with the classes editor in ezpublish admin ? Have you a topic of this ?
@+

log in or create a user account to comment.

Contribution info (stable)

Download