Skip to content

Instantly share code, notes, and snippets.

Christian Hent christianhent

Block or report user

Report or block christianhent

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christianhent
christianhent / map.php
Last active Dec 17, 2017
shows a CartoDB layer with Leaflet
View map.php
<script>
//
var tile = new L.TileLayer('http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> ' +
'contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">' +
'CC-BY-SA</a>. Tiles &copy; <a href="http://carto.com/">' +
'CARTO</a>'
});
</script>
@christianhent
christianhent / map.php
Last active Dec 16, 2017
includes Font-Awesome from CDN
View map.php
<?php
// includes Font-Awesome, goes directly above leaflet.css
$doc->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
?>
@christianhent
christianhent / map.php
Last active Dec 16, 2017
creates the zoomhome-control and add it to the map
View map.php
<script>
// ... existing map code
// ...
map.fitBounds(geoJson.getBounds());
// create the zoomhome-control and add it to the map
var zoomHome = L.Control.zoomHome();
zoomHome.addTo(map);
</script>
@christianhent
christianhent / map.php
Last active Dec 16, 2017
disables the standard zoom control
View map.php
<script>
// ... existing map code
// ...
// set {zoomControl: false} to disable the default zoom control
var map = new L.Map('map',{
fullscreenControl: true,
zoomControl: false,
fullscreenControlOptions: {
position: 'topleft'
},
@christianhent
christianhent / map.php
Last active Dec 16, 2017
includes the relevant JS and CSS references into your layout
View map.php
<?php
// CSS, goes directly below leaflet.css
$doc->addStyleSheet('media/plg_content_zatracks/css/leaflet.zoomhome.css');
// JS, goes directly below leaflet.js
$doc->addScript('media/plg_content_zatracks/js/leaflet.zoomhome.min.js');
?>
View map.php
<script>
// ... existing map code
// ...
// ... your markers code goes here
document.addEventListener("DOMContentLoaded", function(event){
var container = document.getElementById("wpts");
if (typeof(container) != 'undefined' && container != null){
var wpts = document.getElementById("wpts").children;
var string = null;
var title = null;
@christianhent
christianhent / joomla article, markers content
Created Dec 15, 2017
joomla article, map markers for zatracks
View joomla article, markers content
<ul id="wpts" hidden>
<li title="Wöhrder Wiese">49.450647,11.0866813</li>
<li title="Wasserwerk Erlenstegen">49.472041,11.1398093</li>
<li title="Brücke am Pulversee">49.458071,11.1097983</li>
</ul>
@christianhent
christianhent / default.php
Created Dec 15, 2017
alternative zatracks polyline layout
View default.php
<?php if ($displayData['plg_params']['show_map'] == 1 && !empty($trc['polyline']) ) : ?>
<?php $layout = new JLayoutFile('joomla.zatracks.map', $basePath = null, array('suffixes' => array('polyline'),'debug' =>(bool)$dbg));?>
<?php echo $layout->render($trc['polyline']);?>
<?php endif; ?>
@christianhent
christianhent / slideshow.txt
Created Mar 5, 2017
Record a slideshow video from images
View slideshow.txt
#1
/usr/lib/xscreensaver/glslideshow -pan 8 -duration 8 -delay 0 -fade 4 -zoom 75 -clip -geometry 1280x720+0+0 &
#2
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1280x720 -i :0.0+0,29 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0 Videos/slideshow.mkv
#3
ffmpeg -ss 00:00:02 -t 00:01:50 -i Videos/slideshow.mkv -acodec aac -ab 128k -ac 2 -vcodec libx264 -preset slow -crf 20 -threads 0 Videos/slideshow.mp4
@christianhent
christianhent / main.js
Last active Nov 3, 2015
Gerade noch so unter 100 Zeilen
View main.js
$(document).ready(function () {
var obj = {};
obj.jqxhr = $.getJSON('/data/styles.json', function () {
}).done(function (data) {
obj.styles = data;
});
obj.curvature = 0.5;
obj.markers = [];
obj.bounds = new google.maps.LatLngBounds();
obj.curveMarker = null;
You can’t perform that action at this time.