use new geo server for tiles

This commit is contained in:
2019-03-24 00:05:14 +01:00
parent 1dea80d6a1
commit b4b6cea6eb
4 changed files with 7 additions and 26 deletions

View File

@@ -48,7 +48,7 @@ function initPage(asHash) {
self.tmp('mobile', $('#mobile').is(':visible'));
self.tmp('feed_width', self.tmp('mobile')?0:$('#feed').outerWidth(true));
self.tmp('map_offset', -1 * self.tmp('feed_width') / $('body').outerWidth(true));
self.tmp('tile_api', '?a=tile&id={id}&z={z}&x={x}&y={y}');
self.tmp('tile_api', getWmtsApiUrl('{id}', '{y}', '{x}', '{z}'));
self.tmp('markers', 'object');
self.tmp('marker_size', {width: 32, height: 32});
@@ -434,7 +434,7 @@ function getPost(asPost) {
.append($('<p>').addIcon('fa-coords', true).append(asPost.lat_dms+' '+asPost.lon_dms))
.append($('<p>').addIcon('fa-time', true).append(sAbsTime+self.tmp('site_tz_notice')))
.append(
$('<img>', {'class':'staticmap', title: 'Click pour zoomer', src: getStaticMapUrl(asPost.latitude, asPost.longitude)})
$('<img>', {'class':'staticmap', title: 'Click pour zoomer', src: getWmtsApiUrl('static', asPost.latitude, asPost.longitude, 13)})
.click(function(){
var oMarker = oSpot.tmp(['markers', $(this).parent().data('id')]);
self.tmp('map').setOffsetView(self.tmp('map_offset'), oMarker.getLatLng(), 13);
@@ -483,13 +483,7 @@ function getPost(asPost) {
return $Post;
}
function getStaticMapUrl(oCenterLat, oCenterLng) {
return '?'+$.param({
'a': 'tile',
'id': 'static',
'z': 13,
'x': oCenterLng,
'y': oCenterLat
});
function getWmtsApiUrl(sMapId, iLat, iLng, iZoom) {
return self.consts.geo_server+'/?a=tile&id='+sMapId+'&z='+iZoom+'&x='+iLng+'&y='+iLat;
}
</script>