Index: main/plugin-web/i18n/messages_en.xml
===================================================================
--- main/plugin-web/i18n/messages_en.xml (revision 26840)
+++ main/plugin-web/i18n/messages_en.xml (working copy)
@@ -1307,9 +1307,11 @@
Select the display to use when displaying this service
Ametys 3.2 compatibility mode
Default
+ List with map
Pages:
Preceding
Next
+ See on the map
Pages digest
@@ -1407,6 +1409,7 @@
Select the display to use when displaying this service
Ametys 3.2 compatibility mode
Default
+ Contents on a map
Advanced search
Check this box to display the advanced search (all words, exact phrase, any words).
Documents
Index: main/plugin-web/i18n/messages_fr.xml
===================================================================
--- main/plugin-web/i18n/messages_fr.xml (revision 26840)
+++ main/plugin-web/i18n/messages_fr.xml (working copy)
@@ -1308,9 +1308,11 @@
Rendu à utiliser pour l'affichage du service
Mode de compatibilité Ametys 3.2
Par défaut
+ Liste avec carte
Pages :
Précédent
Suivant
+ Voir sur la carte
Remontée de pages
@@ -1408,6 +1410,7 @@
Rendu à utiliser pour l'affichage du service
Mode de compatibilité Ametys 3.2
Par défaut
+ Contenus sur une carte
Recherche avancée
Cochez cette case pour afficher la recherche avancée (tous les mots, expression exacte, aucun des mots).
Documents
Index: main/plugin-web/resources/js/GmapViewer.js
===================================================================
--- main/plugin-web/resources/js/GmapViewer.js (revision 26840)
+++ main/plugin-web/resources/js/GmapViewer.js (working copy)
@@ -17,10 +17,7 @@
function GmapViewer()
{
- var mapId = '#gmap';
- var data = null;
-
- return {
+ return {
addMarkers: function()
{
@@ -39,10 +36,10 @@
animation: google.maps.Animation.DROP
},
icon: {
- image: this.pinImageUrl(record.icon, record.color)
+ image: this.pinImageUrl(record.icon, record.color, record.letter)
},
- html:'<div class="infowindow"><span class="title">'+record.title+'</span><p class="description">'+record.description+'</p></div>'
- });
+ html: this.renderHtmlTooltip(record.title, record.description)
+ });
},
addPolygons: function()
@@ -60,54 +57,139 @@
options: {
fillColor: '#' + record.color,
strokeColor: '#' + record.color,
- html:'<div class="infowindow"><span class="title">'+record.title+'</span><p class="description">'+record.description+'</p></div>'
+ html: this.renderHtmlTooltip(record.title, record.description)
},
- html:'<div class="infowindow"><span class="title">'+record.title+'</span><p class="description">'+record.description+'</p></div>'
- });
+ html: this.renderHtmlTooltip(record.title, record.description)
+ });
+ },
+
+ renderHtmlTooltip: function(title, desc)
+ {
+ return '
'+ title +''
+ + '
'+ (desc || '') +'
'
+ + '
';
},
- pinImageUrl: function (name, color)
+ pinImageUrl: function (name, color, letter)
{
var url = '';
- if (name == 'pin' || name == '')
+ if (letter || name == 'pin' || name == '')
{
- url = "https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|" + color;
+ url = "https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=" + (letter || '') + '|' + color;
}
else
{
- url = "https://chart.googleapis.com/chart?chst=d_map_pin_icon&chld=" + name + "|" + color;
+ url = "https://chart.googleapis.com/chart?chst=d_map_pin_icon&chld=" + name + "|" + color;
}
return url;
},
- setUp: function (mapIdentifier, gdata)
+ setUp: function (mapIdentifier, gdata, fitbounds)
{
this.mapId = mapIdentifier;
this.data = gdata;
+ this.enableFitbounds = !!fitbounds;
- if (this.data && this.mapId)
+ if (this.data && this.mapId)
{
- this.initMap(this.data.lat, this.data.lng, this.data.zoomLevel, this.data.mapTypeId);
+ if (this.gmap)
+ {
+ $j(this.mapId).gMap("removeAllMarkers");
+ $j(this.mapId).gMap("removeAllPolygons");
+ }
+
+ this.prepareFitbounds();
+ this.gmap = this.initMap(this.data.lat, this.data.lng, this.data.zoomLevel, this.data.mapTypeId);
+
+ this.fitbounds();
this.addMarkers();
this.addPolygons();
+
+
}
},
initMap: function (lat, lng, zoomLevel, mapTypeId)
{
- if (this.mapId)
- {
- $j(this.mapId).gMap({
- latitude: lat,
- longitude: lng,
- zoom:zoomLevel,
- maptype:mapTypeId,
- mapTypeControl:true,
- zoomControl:true,
- panControl:true,
- streetViewControl:false
- });
- }
+ if (!this.mapId) return;
+
+ var latitude = lat;
+ var longitude = lng;
+ var c;
+
+ if (this.enableFitbounds && this.boundCount > 0)
+ {
+ c = this.bounds.getCenter();
+ latitude = c.lat();
+ longitude = c.lng();
+ }
+
+// if (!this.gmap)
+// {
+// console.log('???');
+
+ return $j(this.mapId).gMap({
+ latitude: latitude,
+ longitude: longitude,
+ zoom:zoomLevel,
+ maptype:mapTypeId,
+ mapTypeControl:true,
+ zoomControl:true,
+ panControl:true,
+ streetViewControl:false
+ });
+// }
+// else
+// {
+// // do re-init...
+// // set center + zoomlevel
+// console.log('reinit map!!');
+// return this.gmap;
+// }
+ },
+
+ prepareFitbounds: function()
+ {
+ if (!this.enableFitbounds)
+ {
+ return;
+ }
+
+ this.bounds = new google.maps.LatLngBounds();
+ this.boundCount = 0;
+
+ var me = this;
+
+ // markers
+ $j.each(this.data.markers, function (idx, elem) {
+ me.bounds.extend(new google.maps.LatLng(elem.lat, elem.lng));
+ me.boundCount++;
+ });
+
+ // polygons
+ var p, pl, pi;
+ $j.each(this.data.polygons, function (idx, elem) {
+ p = elem.points;
+ pl = p ? p.length : 0;
+
+ if (p)
+ {
+ for (var i = 0; i < pl; i++)
+ {
+ pi = p[i];
+ this.bounds.extend(new google.maps.LatLng(pi.lat, pi.lng));
+ this.boundCount++;
+ }
+ }
+ });
+ },
+
+ fitbounds: function()
+ {
+ if (this.enableFitbounds && this.boundCount >= 2)
+ {
+ this.gmap.data('$gmap').fitBounds(this.bounds);
+ }
}
}
};
\ No newline at end of file
Property changes on: main\plugin-web\resources\js\GmapViewer.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Index: main/plugin-web/resources/js/jquery.gmap.js
===================================================================
--- main/plugin-web/resources/js/jquery.gmap.js (revision 26840)
+++ main/plugin-web/resources/js/jquery.gmap.js (working copy)
@@ -2,7 +2,7 @@
* jQuery gMap v3
*
* @url http://www.smashinglabs.pl/gmap
- * @author Sebastian Poreba <sebastian.poreba@gmail.com>
+ * @author Sebastian Poreba
* @version 3.1.0
* @date 23.04.2011
*/
@@ -68,7 +68,7 @@
// Check for map controls
if (opts.controls.length !== 0) {
// Add custom map controls
- for (var i = 0; i < opts.controls.length; i+= 1) {
+ for (var i = 0; i < opts.controls.length; i+= 1) {
$gmap.controls[opts.controls[i].pos].push(opts.controls[i].div);
}
}
@@ -118,9 +118,9 @@
/**
* Priorities order:
- * - latitude & longitude in options
+ * - latitude & longitude in options
* - address in options
- * - latitude & longitude of first marker having it
+ * - latitude & longitude of first marker having it
* - address of first marker having it
* - failsafe (0,0)
*
@@ -131,8 +131,8 @@
// Create new object to geocode addresses
var center, that = this; // 'that' scope fix in geocoding
- if (opts.latitude && opts.longitude) {
- // lat & lng available, return
+ if (opts.latitude && opts.longitude) {
+ // lat & lng available, return
center = new $googlemaps.LatLng(opts.latitude, opts.longitude);
return center;
} else {
@@ -155,10 +155,10 @@
}
// Check for a marker to center on (if no coordinates given)
- if ($.isArray(opts.markers) && opts.markers.length > 0) {
+ if ($.isArray(opts.markers) && opts.markers.length > 0) {
var selectedToCenter = null;
- for (var i = 0; i < opts.markers.length; i+= 1) {
- if (opts.markers[i].latitude && opts.markers[i].longitude) {
+ for (var i = 0; i < opts.markers.length; i+= 1) {
+ if (opts.markers[i].latitude && opts.markers[i].longitude) {
selectedToCenter = opts.markers[i];
break;
}
@@ -172,7 +172,7 @@
return center;
}
- if (selectedToCenter.latitude && selectedToCenter.longitude) {
+ if (selectedToCenter.latitude && selectedToCenter.longitude) {
return new $googlemaps.LatLng(selectedToCenter.latitude, selectedToCenter.longitude);
}
@@ -266,7 +266,7 @@
var _gshadow = {
image: opts.icon.shadow,
iconSize: new $googlemaps.Size(opts.icon.shadowsize[0], opts.icon.shadowsize[1]),
- anchor: (_gicon && _gicon.iconAnchor)?_gicon.iconAnchor:new $googlemaps.Point(opts.icon.iconanchor[0], opts.icon.iconanchor[1])
+ anchor: (_gicon && _gicon.iconAnchor)?_gicon.iconAnchor:new $googlemaps.Point(opts.icon.iconanchor[0], opts.icon.iconanchor[1])
};
}
@@ -297,12 +297,12 @@
$googlemaps.event.addListener(gmarker, 'click', function() {
if (opts.log) {console.log('opening popup ' + marker.html);}
- if (opts.singleInfoWindow && $data.infoWindow) {$data.infoWindow.close();}
+ if (opts.singleInfoWindow && $data.infoWindow) {$data.infoWindow.close();}
infoWindow.open($gmap, gmarker);
$data.infoWindow = infoWindow;
});
}
- if (marker.html && marker.popup) {
+ if (marker.html && marker.popup) {
if (opts.log) {console.log('opening popup ' + marker.html);}
infoWindow.open($gmap, gmarker);
}
@@ -345,13 +345,13 @@
if (opts.log) {console.log("autozooming map");}
// get position from every marker and extend the "bounds" object with new coordinates
- for (i = 0; i < markers.length; i++)
+ for (i = 0; i < markers.length; i++)
{
bounds.extend(markers[i].getPosition());
}
// if there were markers, now fit the bounds of the map
- if(i>0){
+ if(i>0){
$map.fitBounds(bounds);
}
return this;
@@ -361,7 +361,7 @@
if (markers.length !== 0) {
if (opts.log) {console.log("adding " + markers.length +" markers");}
// Loop through marker array
- for (var i = 0; i < markers.length; i+= 1) {
+ for (var i = 0; i < markers.length; i+= 1) {
methods.addMarker.apply($(this),[markers[i]]);
}
}
@@ -438,7 +438,7 @@
removeAllMarkers: function () {
var markers = this.data('gmap').markers, i;
- for(i = 0; i < markers.length; i += 1) {
+ for(i = 0; i < markers.length; i += 1) {
markers[i].setMap(null);
}
markers = [];
@@ -501,13 +501,13 @@
$googlemaps.event.addListener(gpolygon, 'click', function() {
if (opts.log) {console.log('opening popup ' + polygonOpts.html);}
- if (opts.singleInfoWindow && $data.infoWindow) {$data.infoWindow.close();}
+ if (opts.singleInfoWindow && $data.infoWindow) {$data.infoWindow.close();}
if (opts.log) {console.log(gpolygon)}
infoWindow.open($gmap);
$data.infoWindow = infoWindow;
});
}
- if (polygonOpts.html && polygonOpts.popup) {
+ if (polygonOpts.html && polygonOpts.popup) {
if (opts.log) {console.log('opening popup ' + gpolygon.html);}
infoWindow.open($gmap, gpolygon);
}
@@ -517,7 +517,7 @@
removeAllPolygons: function () {
var polygons = this.data('gmap').polygons, i;
- for(i = 0; i < polygons.length; i += 1) {
+ for(i = 0; i < polygons.length; i += 1) {
polygons[i].setMap(null);
}
polygons = [];
@@ -565,8 +565,8 @@
singleInfoWindow: true,
- html_prepend: '<div class="gmap_marker">',
- html_append: '</div>',
+ html_prepend: '',
+ html_append: '
',
icon: {
image: "http://www.google.com/mapfiles/marker.png",
iconsize: [20, 34],
Property changes on: main\plugin-web\resources\js\jquery.gmap.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Index: main/plugin-web/pages/services/filtered-contents/map-list.xml
===================================================================
--- main/plugin-web/pages/services/filtered-contents/map-list.xml (revision 0)
+++ main/plugin-web/pages/services/filtered-contents/map-list.xml (revision 0)
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
Index: main/plugin-web/pages/services/filtered-contents/map-list.xsl
===================================================================
--- main/plugin-web/pages/services/filtered-contents/map-list.xsl (revision 0)
+++ main/plugin-web/pages/services/filtered-contents/map-list.xsl (revision 0)
@@ -0,0 +1,253 @@
+
+
+
+
+
+
+
+ filtered-contents filtered-contents- map-list
+
+
+
+
+ 95499C|F7F7F8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ empty
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ content-list-item
+
+
+
+
+
+
+ 2
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: main/plugin-web/pages/services/filtered-contents/list_3.3.xsl
===================================================================
--- main/plugin-web/pages/services/filtered-contents/list_3.3.xsl (revision 26840)
+++ main/plugin-web/pages/services/filtered-contents/list_3.3.xsl (working copy)
@@ -243,6 +243,12 @@
document.getElementById("content_filter_prev_").style.display = (pagination__current == "0" ? 'none' : '');
document.getElementById("content_filter_next_").style.display = (pagination__current == (pagination_.length - 1) ? 'none' : '');
+
+ // onPaginationShow hook.
+ if ($j.isFunction(onPaginationShow))
+ {
+ onPaginationShow(count + 1);
+ }
}
}
Index: main/plugin-web/pages/services/search/search-map.xml
===================================================================
--- main/plugin-web/pages/services/search/search-map.xml (revision 0)
+++ main/plugin-web/pages/services/search/search-map.xml (revision 0)
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
Index: main/plugin-web/pages/services/search/hit/hit_3.3.xsl
===================================================================
--- main/plugin-web/pages/services/search/hit/hit_3.3.xsl (revision 26840)
+++ main/plugin-web/pages/services/search/hit/hit_3.3.xsl (working copy)
@@ -47,43 +47,49 @@
hit page
-
+
-
-
-
- /
-
- .html
-
-
- &
- ?
-
- search-keywords=
-
-
- ,
-
- ,
-
-
-
-
- ,
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+ /
+
+ .html
+
+
+ &
+ ?
+
+ search-keywords=
+
+
+ ,
+
+ ,
+
+
+
+
+ ,
+
+
+
+
+
Index: main/plugin-web/pages/services/search/search-map.xsl
===================================================================
--- main/plugin-web/pages/services/search/search-map.xsl (revision 0)
+++ main/plugin-web/pages/services/search/search-map.xsl (revision 0)
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+ search search-criteria search-map
+
+
+
+
+ 95499C|F7F7F8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hit page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: main/plugin-web/src/org/ametys/web/frontoffice/AbstractSearchGenerator.java
===================================================================
--- main/plugin-web/src/org/ametys/web/frontoffice/AbstractSearchGenerator.java (revision 26840)
+++ main/plugin-web/src/org/ametys/web/frontoffice/AbstractSearchGenerator.java (working copy)
@@ -620,6 +620,14 @@
XMLUtils.createElement(contentHandler, "siteUrl", url);
}
}
+
+ String[] coordinates = doc.getValues(GEOCODE_COORDINATES);
+ if (coordinates.length > 0)
+ {
+ String[] latLng = StringUtils.split(coordinates[0], ',');
+ XMLUtils.createElement(contentHandler, "latitude", latLng[0]);
+ XMLUtils.createElement(contentHandler, "longitude", latLng[1]);
+ }
saxAdditionalInfosOnPageHit (doc);