Skip to content

Site Geo Map does not show on Alfresco 4.2.c #1

@smcardle

Description

@smcardle

After dropping the jar file into the shared/lib directory on Tomcat, add the Site Geo Map to any of your sites and neither the map nor the toolbar show up.

To Resolve this issue :

The problem is likely in the geo jar file itself. But rather than un-assemble the jar, find the issue, fix, re-assemble the jar you can do the following.

The problem is that when the Share page with the Site Geo View is constructed there is a <script>...</script> element defined for the Google Maps API as follows....

<script src="/share/res/http://maps.google.com/maps/api/js?sensor=false" type="text/javascript">

The mapping for these URL's in the share web.xml file does not handle this type of URL and ends up not resolving to the target URL http://maps.google.com/maps/api/js?sensor=false

To fix this I added 2 entries to the urlrewrite.xml file in the Share WEB-INF/urlrewrite.xml file as follows

  <rule>
      <condition type="scheme" operator="equal">http</condition>
      <from>^/res/http:(.*)</from>
      <to type="permanent-redirect">http:$1</to>'
   </rule> 
   <rule>
      <condition type="scheme" operator="equal">https</condition> 
      <from>^/res/http:(.*)</from> 
      <to type="permanent-redirect">https:$1</to> 
   </rule>

These entries MUST be placed BEFORE the existing ^/res/(.*) entry so that they get resolved first.

The reason I added the 2 entries is because I use both http and https

If you only add a pattern for http without the https scheme you will get an error stating the content returned is not text

Anyway, the real fix should be made to the <script>..</script> entry generation in the Geo JAR file but with these simple changes, it now works on my system and I hope this helps somebody else out as well.

This may also be a good idea to add these entries in the standard Alfresco urlrewrite.xml deployment anyway.

Steve

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions