@param Map           $map
@param MarkerShape[] $markerShapes

@return MarkerShape[]
175651
public function collect(Map $map, array $markerShapes = [])
    {
        foreach ($this->markerCollector->collect($map) as $marker) {
            if ($marker->hasShape()) {
                $markerShapes = $this->collectValue($marker->getShape(), $markerShapes);
            }
        }

        return $markerShapes;
    }
983817
public function render(Map $map)
    {
        return $this->renderHtml($map).$this->renderStylesheet($map).$this->renderJavascript($map);
    }
46841
public function registerMaps(array $maps)
    {
        foreach ($maps as $name => $map) {
            $this->maps[$name] = $map;
        }

        return $this;
    }
1351599
public function collect(Map $map, array $encodedPolylines = [])
    {
        return $this->collectValues($map->getOverlayManager()->getEncodedPolylines(), $encodedPolylines);
    }
1114259
protected function getMappedKey($map, $key)
    {
        if (is_array($map)) {
            if (array_key_exists($key, $map)) {
                return $map[$key];
            } else {
                return $key;
            }
        }
        return $key;
    }
268456
protected function typeMapReducer(array $map, $type)
    {
        if ($type instanceof ModifierInterface) {
            return $this->typeMapReducer($map, $type->getWrappedType());
        }

        if (!$type instanceof TypeInterface) {
            return $map;
        }

        if (!empty($map[$type->getName()])) {
            if ($type instanceof ObjectType || $type instanceof InterfaceType) {
                $type->setFields($map[$type->getName()]->getFields());
            }

            return $map;
        }

        $reducedMap = array_merge($map, [$type->getName() => $type]);
        if ($type instanceof InterfaceType || $type instanceof UnionType) {
            $reducedMap = array_reduce(
                $type->getPossibleTypes(), [$this, 'typeMapReducer'], $reducedMap
            );
        }

        if ($type instanceof ObjectType) {
            $reducedMap = array_reduce(
                $type->getInterfaces(), [$this, 'typeMapReducer'], $reducedMap
            );
        }

        if ($type instanceof ObjectType || $type instanceof InterfaceType) {
            foreach ($type->getFields() as $fieldName => $field) {
                $args = $field->getArguments();
                $reducedMap = array_reduce(array_map(function (FieldArgument $arg) {
                    return $arg->getType();
                }, $args), [$this, 'typeMapReducer'], $reducedMap);

                $reducedMap = $this->typeMapReducer($reducedMap, $field->getType());
            }
        }

        return $reducedMap;
    }
605261
private function createEvent(Map $map, Marker $marker)
    {
        $formatter = $this->getFormatter();

        $rawEvent = new Event(
            $marker->getVariable(),
            $marker->getInfoWindow()->getOpenEvent(),
            $formatter->renderClosure($formatter->renderLines([
                $formatter->renderCall(
                    $formatter->renderProperty(
                        $formatter->renderContainerVariable($map, 'functions'),
                        'info_windows_close'
                    ),
                    [],
                    true
                ),
                $formatter->renderCode(
                    $this->getInfoWindowOpenRenderer()->render($marker->getInfoWindow(), $map, $marker),
                    true,
                    false
                ),
            ]))
        );

        $rawEvent->setVariable($marker->getVariable().'_info_window_open_event');

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

		return $map;
	}
999838
public function collect(Map $map, array $rectangles = [])
    {
        return $this->collectValues($map->getOverlayManager()->getRectangles(), $rectangles);
    }
300559
protected function _extractBehaviors(array $map) {
		$result = [];
		foreach ($map as $name => $behavior) {
			$behaviorClassName = get_class($behavior);
			$pluginName = $this->_resolvePluginName($behaviorClassName, $name);
			if ($pluginName === null) {
				continue;
			}
			if ($pluginName) {
				$pluginName .= '.';
			}
			$result[$name] = $pluginName . $name;
		}

		return $result;
	}
732293
public static function mapDescendantsArray(Tree $parent, Array $map)
    {
        foreach ($map as $item) {
            $node = new static($item);
            $node->setChildOf($parent);
            if (isset($item['children'])) {
                static::mapDescendantsArray($node, $item['children']);
            }
        }

    }
1254172
public function build(Map $map)
    {
        $this->map = $map;
        $data = $this->getData();
        $this->setMapDefaults($data);
        $routes = (array_key_exists('routes', $data))
            ? $data['routes']
            : [];
        foreach ($routes as $name => $definition) {
            $this->getRouteFactory()
                ->parse($name, $definition, $this->map);
        }
        return $this;
    }
1082363
public function setSubmittedMapped(array $map, $params = null, array $default = array())
    {
        $mapped = $this->mapParams($map, $params);
        $merged = gplcart_array_merge($default, $mapped);

        return $this->setSubmitted(null, $merged);
    }
1242084
public function render(Polyline $polyline, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[map]', $map->getVariable(), false)
            ->setValue('[path]', []);

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

        foreach ($polyline->getIconSequences() as $index => $icon) {
            $jsonBuilder->setValue('[icons]['.$index.']', $icon->getVariable(), false);
        }

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

        return $formatter->renderObjectAssignment($polyline, $formatter->renderObject('Polyline', [
            $jsonBuilder->build(),
        ]));
    }
330769
public static function map(array $object, array $map)
    {
        $result = [];

        foreach ($map as $from => $to) {
            if ( ! isset($object[$from])) {
                continue;
            }

            $result[$to] = $object[$from];
        }

        return $result;
    }
386438
public function setMap($map = []) {
        $this->flush();
        $this->shared = array_fill_keys($map, null);
        $this->type = static::TYPE_DEFINED_ONLY;
        return $this;
    }
890167
private function mapNames(&$hash, &$map)
	{
		$ret = array();

		foreach ($hash as $name => &$value)
		{
			if (array_key_exists($name,$map))
				$name = $map[$name];

			$ret[$name] = $value;
		}
		return $ret;
	}