Вход Регистрация
Файл: sngine-v2.8/Script/includes/libs/Embed/Adapters/Carto.php
Строк: 19
<?php

namespace EmbedAdapters;

use 
EmbedHttpResponse;
use 
EmbedUtils;

/**
 * Adapter to get the embed code from cartodb.
 */
class Carto extends Webpage
{
    
/**
     * {@inheritdoc}
     */
    
public static function check(Response $response)
    {
        return 
$response->isValid() && $response->getUrl()->match([
            
'*.carto.com/viz/*/public_map',
        ]);
    }

    
/**
     * {@inheritdoc}
     */
    
public function getCode()
    {
        
$this->width null;
        
$this->height 520;

        
$url $this->getResponse()->getUrl()->withDirectoryPosition(2'embed_map');

        return 
Utils::iframe($url'100%'$this->height);
    }
}
Онлайн: 0
Реклама