Personal tools
You are here: Home Forums Plone Google Maps geolocation and ArchGenXML
Document Actions

geolocation and ArchGenXML

Up to Plone Google Maps

geolocation and ArchGenXML

Posted by Stefan Armbruster at February 03. 2007

By default, the geolocation tab only appears on ATDocument, ATLink, ATEvent and ATImage. How do I add this tab to custom content types created by ArchGenXML? Is there a special stereotype to use, or do I have to create a configure.zcml? It would be helpful to see an example for this.


Thanks, Stefan


Re: geolocation and ArchGenXML

Posted by Vitaliy Podoba at February 05. 2007

For adding geolocation tab to your custom content types you need to modify two files in gelocation product or modify configure.zcml file in your own product and register content type action 'geolocation' by hand in ZMI:


  1. configure.zcml - in root folder of product

add next few lines for every new content type:


  <five:implements
        class="python.path.to.your.content.type.class"
        interface="zope.app.annotation.IAttributeAnnotatable" />

  <adapter
      for="python.path.to.interface.class.implemented.by.your.content.type"
      provides="Products.geolocation.interfaces.geolocation.IGEOLocated"
      factory="Products.geolocation.adapters.geolocation.GEOLocated"
      />

  <adapter

      for="python.path.to.interface.class.implemented.by.your.content.type"

      provides="Products.geolocation.
interfaces.geomap.IGEOMap"

      factory="Products.geolocation
.adapters.geomap.GEOMap"

      />




2. Extensions/Install.py - installation script
        in the beginning of script defined list variable PORTAL_TYPES, it includes all content type names, for which will be registered 'geolocation' action
You need to add to this list your own content types.
For example:

    PORTAL_TYPES= ['Document', 'News Item', 'Event', 'Link', 'Image', 'My Own Content Type 1', 'My Own Content Type 2']

Re: geolocation and ArchGenXML

Posted by Michael Patrick at March 21. 2007

After searching the documentation, readme files, etc., I don't see any EXACT example of how the Google Maps API key is to be placed into the Map Properties Dialog. I tested the API key by redirecting the the URL to the test page Google Maps generates with the key, it worked fine with the sample. I then place the key into the box as follows: Google gave me back


ABQIAAAAwzBhqtMK3cV2VaXFESE4xBSzhotYepA16MVNrA6laZURmtJw2xR3nQQLXgsXdPOhUAgAoeXKA2j66Q

This key is good for all URLs in this directory:


 


http://www.globalwa.org/

I then placed the following in the Properties box, where the directions say


qPloneGoogleMaps Settings



Google Maps API Keys settings.


Map Api Keys

Here you can enter "portal root|map api key" pairs for your maps.


http://www.globalwa.org/|ABQIAAAAwzBhqtMK3cV2VaXFESE4xBSzhotYepA16MVNrA6laZURmtJw2xR3nQQLXgsXdPOhUAgAoeXKA2j66Q



No quotations marks, just the base URL that was returned by Google, vertical bar, then the key. I also tried to examine the code on trac

   where there was a line that said:


 


MAP_API_KEYS = ["http://gewgaw.office.quintagroup.com:8888/map|ABQIAAAAPKXXAksH6LF9wD3-iB3Z9hR-_Derz1M-sZYUdeXG3J1uZOMrKxT98efydo7fhYu6kuaFv5ESjlw4mw", ]

 


Which made me mostly believe mostly I was using the correct syntax. However, after setting the keys both in Zope and from Plone settings, stopping and restarting Zope, I still get the "This key is assigned to another web site ... you can get a key at ... " error when i attempt to use the control. Is there some missing apostrophes, quote marks or brackets that need to go around the key? Or is the trailing slash on the root domain needed?


 


Any help would be appreciated, I'm a noob at this.


 


Thanks for your time and consideration,


 


Michael


 


 


 


Powered by Ploneboard