Skip to content
Permalink
Browse files

Merge pull request #115 from borazslo/master

Cron Sqlite tűzoltás + ki térkép frissítés
  • Loading branch information...
borazslo committed Apr 28, 2019
2 parents 6da0e51 + 61db6be commit b667448a2c1fd5bc53457aa9f0cc09344db7508a
@@ -76,11 +76,9 @@ function generateSqlite() {
echo "Sqlite is beginning right now...";
if(!isset($this->sqliteFilePath)) {
$this->setFilePath();
}
}
$this->connectToSqlite('sqlite_v' . $this->version, $this->sqliteFilePath);
$this->sqlite->beginTransaction();
$this->dropAllTables();
echo "\nCreate Tables ...";
$this->createTables();
@@ -212,13 +210,14 @@ function insertDataTemplomok() {
];
//Location
$insert['orszag'] = $church->location->country;
//print_r($church->location);
$insert['orszag'] = $church->location->country['name'];
if (isset($church->location->county)) {
$insert['megye'] = $church->location->county;
$insert['megye'] = $church->location->county['name'];
} else {
$insert['megye'] = "";
}
$insert['varos'] = $church->location->city;
$insert['varos'] = $church->location->city['name'];
$insert['cim'] = $church->cim;
$insert['geocim'] = $church->geoaddress;
$insert['lng'] = $church->location->lon;
@@ -366,8 +365,9 @@ function checkSqliteFile() {
}
function cron() {
for ($i = 2; $i <= 4; $i++) {
for ($i = 4; $i >= 4; $i--) {
$_REQUEST['v'] = $i;
$this->version = $i;
$this->run();
}
}
@@ -12,7 +12,7 @@ class OverpassApi extends \ExternalApi\ExternalApi {
function buildQuery() {
$this->rawQuery = "[out:json][timeout:" . $this->queryTimeout . "];";
$this->rawQuery .= $this->query;
$this->rawQuery = "?data=" . urlencode($this->rawQuery);
$this->rawQuery = "?data=" . urlencode($this->rawQuery);
}
function buildEnclosingBoundariesQuery($lat, $lon) {
@@ -98,7 +98,7 @@ function saveOsmEnclosingRelation(\Eloquent\OSM $osm) {
function saveElement() {
if (!$this->jsonData->elements) {
throw new Exception("Missing Json Elements from OverpassApi Query");
throw new \Exception("Missing Json Elements from OverpassApi Query");
}
$now = time();
@@ -1,29 +1,53 @@
{% extends 'panel.twig' %}

{% set title = 'Elhelyezkedés' ~ '&nbsp;<a href="https://www.google.com/maps/dir//' ~ location.lat ~ ',' ~ location.lon ~ '" target="_blank"><i class="' ~ ICONS_MAP_DIRECTION ~ ' title="Útvonaltervezés a Google Maps segítségével."></i></a>' %}

{% if location.lat %}
{% set title = 'Elhelyezked&eacute;s' ~ '&nbsp;<a href="https://www.google.com/maps/dir//' ~ location.lat ~ ',' ~ location.lon ~ '" target="_blank"><i class="' ~ ICONS_MAP_DIRECTION ~ ' title="Útvonaltervezés a Google Maps segítségével."></i></a>' %}
{% else %}
{% set title = 'Elhelyezked&eacute;s' %}
{% endif %}

{% if location.osm is not null %}
{% set panel = 'primary' %}
{% endif %}

{% set id = 'panel-map' %}

{% block body %}
<div id="map" style="height:260px; margin-top: -15px;margin-right: -15px;margin-bottom: 15px;margin-left: -15px;"></div>
<script>
function initMap() {
var uluru = {lat: {{ location.lat }}, lng: {{ location.lon }}};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: uluru
});
var marker = new google.maps.Marker({
position: uluru,
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAFPvPprk1tXLz8l_Urbvu4OmwAgz_v8o0&callback=initMap">
</script>
<style>
#panel-map .panel-body {
padding: 0;
}
#maptext {
padding: 15px;
}
</style>
{% if location.lat %}
<div id="map" style="height:260px;"></div>

<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script>
map = new OpenLayers.Map("map");
map.addLayer(new OpenLayers.Layer.OSM());
var lonLat = new OpenLayers.LonLat( {{ location.lon }}, {{ location.lat}} )
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
);
var zoom=16;
var markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(lonLat));
map.setCenter (lonLat, zoom);
</script>
{% endif %}

<div id="maptext">
{% if not user.isadmin %}
<span class=alap>
{% if location.country and location.country.name != 'Magyarország' %}{{ location.country.name }} <br/>{% endif %}
@@ -64,6 +88,7 @@
{% endif %}
<br/>
{% if location.access %}{{ location.access|raw|nl2br }} {% endif %}
</div>
{% endblock %}

{% macro osmlink(osm,title = false) %}
@@ -0,0 +1,73 @@
{% extends 'panel.twig' %}

{% set title = 'Elhelyezkedés' ~ '&nbsp;<a href="https://www.google.com/maps/dir//' ~ location.lat ~ ',' ~ location.lon ~ '" target="_blank"><i class="' ~ ICONS_MAP_DIRECTION ~ ' title="Útvonaltervezés a Google Maps segítségével."></i></a>' %}

{% if location.osm is not null %}
{% set panel = 'primary' %}
{% endif %}

{% block body %}
<div id="map" style="height:260px; margin-top: -15px;margin-right: -15px;margin-bottom: 15px;margin-left: -15px;"></div>
<script>
function initMap() {
var uluru = {lat: {{ location.lat }}, lng: {{ location.lon }}};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: uluru
});
var marker = new google.maps.Marker({
position: uluru,
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAFPvPprk1tXLz8l_Urbvu4OmwAgz_v8o0&callback=initMap">
</script>
{% if not user.isadmin %}
<span class=alap>
{% if location.country and location.country.name != 'Magyarország' %}{{ location.country.name }} <br/>{% endif %}
{% if location.county and location.county.name != location.country.name %} {{ location.county.name }}<br/>{% endif %}
{% if location.city %}{{ location.city.name }}{% endif %}{% if location.district %}, {{ location.district.name }}{% endif %}<br/>
{% if location.address %}{{ location.address }}{% endif %}
</span><br/>
{% else %}
<span class=alap>
{% for loc in [location.country, location.county, location.city, location.district] %}
<a href="/collection/{{ loc.osmtype }}:{{ loc.osmid }}">{{ loc.name }}</a><br/>
{% endfor %}
</span><br/>
{% endif %}

{% if location.osm is not null %}
<span class=alap>
<i>Térkép: </i>
<u><a target="_blank" href="{{ location.osm.url }}">
{{ location.lat|number_format(5, '.') }}, {{ location.lon|number_format(5, '.') }}
</a></u>
&nbsp;<a href="https://www.google.com/maps/dir//{{ location.lat }},{{ location.lon }}" target="_blank"><i class="{{ ICONS_MAP_DIRECTION }}" title="Útvonaltervezés a Google Maps segítségével."></i></a>
{% if user.isadmin %}&nbsp;<a href="https://www.openstreetmap.org/edit?editor=id&{{ location.osm.type }}={{ location.osm.id }}#map=19/{{ location.lat }}/{{ location.lon }}" target="_blank"><i class="{{ ICONS_MAP_EDIT }}"title="OSM szerkesztése..."></i></a>{% endif %}
</span>
{% elseif location.lat %}
<span class=alap>
<i>Térkép: </i>
<u><a target="_blank" href="http://www.openstreetmap.org/?mlat={{ location.lat }}&mlon={{ location.lon }}#map=19/{{ location.lat }}/{{ location.lon }}">
{{ location.lat|number_format(5, '.') }}, {{ location.lon|number_format(5, '.') }}
</a></u>
&nbsp;<a href="https://www.google.com/maps/dir//{{ location.lat }},{{ location.lon }}" target="_blank"><i class="{{ ICONS_MAP_DIRECTION }}" title="Útvonaltervezés a Google Maps segítségével."></i></a>
{% if user.isadmin %}&nbsp;<a href="https://www.openstreetmap.org/edit?editor=id#map=19/{{ location.lat }}/{{ location.lon }}" target="_blank"><i class="{{ ICONS_MAP_EDIT }}" title="OSM szerkesztése..."></i></a>{% endif %}
</span>
{% else %}
<span class=alap>
<strong>Segíts megtalálni a térképen!</strong>
</span>
{% endif %}
<br/>
{% if location.access %}{{ location.access|raw|nl2br }} {% endif %}
{% endblock %}

{% macro osmlink(osm,title = false) %}
<!--<a href="/collection/{{ osm.osmtype }}:{{ osm.osmid }}" title="{{ title }}">{{ osm.name }}</a>-->
<a href="{{ osm.url }}" title="{{ title }}" target="_blank">{{ osm.name }}</a>
{% endmacro %}

@@ -1,5 +1,5 @@
<div class="panel-group hidden-xs" id="accordion">
<div class="panel panel-{{ panel ? panel : 'default' }}">
<div class="panel panel-{{ panel ? panel : 'default' }}" {% if id %}id="{{id}}"{% endif %}>
{% if title %}
<div class="panel-heading">
<h4 class="panel-title">

0 comments on commit b667448

Please sign in to comment.
You can’t perform that action at this time.