convert to leaflet

This commit is contained in:
2018-10-07 11:46:50 +02:00
parent 00cb4790b6
commit 2c146e6236
10 changed files with 755 additions and 100 deletions

View File

@@ -7,7 +7,6 @@ class Spot extends Main
const MODE_BLOG = 'blog';
//Spot feed
const FEED_ID = '0Y5LrvigElWeAieBGnFol0KBEuOTkFJmm';
const FEED_HOOK = 'https://api.findmespot.com/spot-main-web/consumer/rest-api/2.0/public/feed/';
const FEED_TYPE_XML = '/message.xml';
const FEED_TYPE_JSON = '/message.json';
@@ -37,7 +36,7 @@ class Spot extends Main
$this->oDb->install();
//Add feed
//$this->oDb->insertRow(self::FEED_TABLE, array('ref_feed_id'=>self::FEED_ID));
//$this->oDb->insertRow(self::FEED_TABLE, array('ref_feed_id'=>Settings::FEED_ID));
}
protected function getSqlOptions()
@@ -89,27 +88,26 @@ class Spot extends Main
return parent::getMainPage(
array(
'vars' => array(
'feed_id' => self::FEED_ID,
'feed_id' => Settings::FEED_ID,
'chunk_size'=> self::FEED_CHUNK_SIZE,
'mode' => Settings::MODE,
'google_api'=> Settings::GOOGLE_MAPS_API_KEY
'mapbox_key'=> Settings::MAPBOX_KEY
)
),
'index',
array('GOOGLE_MAPS_API_KEY' => Settings::GOOGLE_MAPS_API_KEY)
'index'
);
}
/* Getting & Storing messages */
private function getFeed($sRefFeedId=self::FEED_ID)
private function getFeed($sRefFeedId=Settings::FEED_ID)
{
$sUrl = self::FEED_HOOK.$sRefFeedId.self::FEED_TYPE_JSON;
$sContent = file_get_contents($sUrl);
return json_decode($sContent, true);
}
private function updateFeed($sRefFeedId=self::FEED_ID)
private function updateFeed($sRefFeedId=Settings::FEED_ID)
{
$asData = $this->getFeed($sRefFeedId);
$asMsgs = $asData['response']['feedMessageResponse']['messages'];
@@ -152,7 +150,7 @@ class Spot extends Main
}
}
public function getMessages($sRefFeedId=self::FEED_ID)
public function getMessages($sRefFeedId=Settings::FEED_ID)
{
/* Adding another point to test
$test = $this->oDb->selectRow(self::MSG_TABLE, 1);