@param Map $map

@return string
174864
public function render(Map $map)
    {
        $styles = [];
        $stylesheets = [
            'width'  => $map->hasStylesheetOption('width') ? $map->getStylesheetOption('width') : '300px',
            'height' => $map->hasStylesheetOption('height') ? $map->getStylesheetOption('height') : '300px',
        ];

        foreach ($stylesheets as $stylesheet => $value) {
            $styles[] = $this->stylesheetRenderer->render($stylesheet, $value);
        }

        return $this->getTagRenderer()->render('div', null, array_merge($map->getHtmlAttributes(), [
            'id'    => $map->getHtmlId(),
            'style' => implode('', $styles),
        ]));
    }
114215
public static function getToggledValues($map)
    {
        return Collection::make($map)->map(function ($condition, $value) {
            if (is_numeric($value)) {
                return $condition;
            }

            return $condition ? $value : null;
        })->filter()->toArray();
    }
161439
protected function define(MapperDefinition $map)
    {
        $map->type(ObjectMetadataKeyValuePair::class);

        $map->property(ObjectMetadataKeyValuePair::KEY)->to('key')->unique()->asVarchar(500);

        $map->property(ObjectMetadataKeyValuePair::VALUE)
            ->mappedVia(function ($value) {
                return json_encode($value);
            }, function (string $json) {
                return @json_decode($json, true);
            })
            ->to('value')
            ->asMediumText();
    }
204454
public function build(Map $map)
    {
        $this->setDefaults($map);
        $this->addRoutes($map);
        return $this;
    }
150677
public function createMapping(array $map)
    {
        try {
            $elasticclient = $this->client->getClient();
            $response = $elasticclient->indices()->create($map);
            return  $response['acknowledged'];
        } catch (\Exception $ex) {
            return $ex->getMessage();
        }
    }
322827
public function mapMaker(?string $maker): ?string
    {
        if (null === $maker) {
            return null;
        }

        switch (mb_strtolower(trim($maker))) {
            case '':
            case 'unknown':
            case 'other':
            case 'bot':
            case 'various':
                $maker = null;
                break;
            case 'microsoft':
            case 'microsoft corporation.':
                $maker = 'Microsoft Corporation';
                break;
            case 'apple':
            case 'apple inc.':
            case 'apple computer, inc.':
                $maker = 'Apple Inc';
                break;
            case 'google':
            case 'google inc.':
            case 'google, inc.':
                $maker = 'Google Inc';
                break;
            case 'lunascape & co., ltd.':
                $maker = 'Lunascape Corporation';
                break;
            case 'opera software asa.':
                $maker = 'Opera Software ASA';
                break;
            case 'sun microsystems, inc.':
                $maker = 'Oracle';
                break;
            case 'postbox, inc.':
                $maker = 'Postbox Inc';
                break;
            case 'comodo group, inc.':
                $maker = 'Comodo Group Inc';
                break;
            case 'canonical ltd.':
                $maker = 'Canonical Ltd';
                break;
            case 'gentoo foundation, inc.':
                $maker = 'Gentoo Foundation Inc';
                break;
            case 'omni development, inc.':
                $maker = 'Omni Development Inc';
                break;
            case 'slackware linux, inc.':
                $maker = 'Slackware Linux Inc';
                break;
            case 'red hat, inc.':
                $maker = 'Red Hat Inc';
                break;
            case 'rim':
                $maker = 'Research In Motion Limited';
                break;
            case 'mozilla':
                $maker = 'Mozilla Foundation';
                break;
            case 'majestic-12':
                $maker = 'Majestic-12 Ltd';
                break;
            case 'zum internet':
                $maker = 'ZUMinternet Corp';
                break;
            case 'mojeek ltd.':
                $maker = 'Linkdex Limited';
                break;
            default:
                // nothing to do here
                break;
        }

        return $maker;
    }
702197
protected function optimizeLooseMap(array $map)
	{
		foreach ($map as $k => $v)
		{
			if ($k === $v)
			{
				unset($map[$k]);
			}
		}

		return $map;
	}
698807
public function render(Polygon $polygon, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[map]', $map->getVariable(), false)
            ->setValue('[paths]', []);

        foreach ($polygon->getCoordinates() as $index => $coordinate) {
            $jsonBuilder->setValue('[paths]['.$index.']', $coordinate->getVariable(), false);
        }

        $jsonBuilder->setValues($polygon->getOptions());

        return $formatter->renderObjectAssignment($polygon, $formatter->renderObject('Polygon', [
            $jsonBuilder->build(),
        ]));
    }
410320
public function render(Map $map)
    {
        return $this->getFormatter()->renderObjectCall(
            $map,
            'fitBounds',
            [$map->getBound()->getVariable()]
        );
    }
871192
public static String asString(Map<?, ?> map) {
        if (map == null) {
            return NULL;
        }
        StringBuilder builder = new StringBuilder();
        builder.append('{');
        boolean first = true;
        for (Map.Entry<?, ?> entry : map.entrySet()) {
            if (first) {
                first = false;
            } else {
                builder.append(',');
            }
            builder.append(asString(entry.getKey()))
                   .append(':')
                   .append(asString(entry.getValue()));
        }
        builder.append('}');
        return builder.toString();
    }
112401
public function parseMappedColumn($mapping)
    {
        $segments = explode('.', $mapping);

        $column = array_pop($segments);

        $target = implode('.', $segments);

        return [$target, $column];
    }
211338
private function buildMapping($mapping)
    {
        foreach ($mapping as $field => $type) {
            $mapping[$field] = $this->buildType($type);
        }

        return $mapping;
    }
755427
public function render(Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder();

        $options = $map->getMapOptions();
        unset($options['mapTypeId']);

        if (!$map->isAutoZoom()) {
            if (!isset($options['zoom'])) {
                $options['zoom'] = 3;
            }
        } else {
            unset($options['zoom']);
        }

        $this->controlManagerRenderer->render($map->getControlManager(), $jsonBuilder);

        $jsonBuilder
            ->setValue(
                '[mapTypeId]',
                $this->mapTypeIdRenderer->render($map->getMapOption('mapTypeId') ?: MapTypeId::ROADMAP),
                false
            )
            ->setValues($options);

        return $formatter->renderObjectAssignment($map, $formatter->renderObject('Map', [
            $formatter->renderCall(
                $formatter->renderProperty('document', 'getElementById'),
                [$formatter->renderEscape($map->getHtmlId())]
            ),
            $jsonBuilder->build(),
        ]));
    }
176133
public function render(GeoJsonLayer $geoJsonLayer, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()->setValues($geoJsonLayer->getOptions());

        return $formatter->renderObjectCall($map, $formatter->renderProperty('data', 'loadGeoJson'), [
            $formatter->renderEscape($geoJsonLayer->getUrl()),
            $jsonBuilder->build(),
        ]);
    }
672653
public Map<String, String> getHeadersToMap(Map<String, String> map) {
        if (map == null) map = new LinkedHashMap<>();
        final Map<String, String> map0 = map;
        header.forEach((k, v) -> map0.put(k, v));
        return map0;
    }
454671
public function render(Circle $circle, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[map]', $map->getVariable(), false)
            ->setValue('[center]', $circle->getCenter()->getVariable(), false)
            ->setValue('[radius]', $circle->getRadius())
            ->setValues($circle->getOptions());

        return $formatter->renderObjectAssignment($circle, $formatter->renderObject('Circle', [
            $jsonBuilder->build(),
        ]));
    }
1060853
protected function formatRespond($map) {
        $envelope = \App::make('Greplab\Jsonrpcsmd\Envelope\\' . $this->envelope, array($this));
        return $envelope->build($map);
    }