@param Map        $map
@param InfoWindow $infoWindow
@param bool       $position

@return string
974897
private function renderInfoBox(Map $map, InfoWindow $infoWindow, $position = true)
    {
        return $this->getFormatter()->renderContainerAssignment(
            $map,
            $this->getInfoBoxRenderer()->render($infoWindow, $position),
            'overlays.info_boxes',
            $infoWindow
        );
    }
816262
public function save($data, $map)
    {
        is_array($map) || $map = [
            'id' => $map
        ];
        
        // 修改时间
        if ($this->autoWriteTimestamp && ! (isset($data[$this->updateTime]) && $data[$this->updateTime])) {
            $data[$this->updateTime] = time();
        }
        
        return $this->where($map)->update($data);
    }
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;
    }
435119
public static function htmlFactPlaceIcon(
			\Fisharebest\Webtrees\Fact $fact,
			\MyArtJaub\Webtrees\Map\MapProviderInterface $mapProvider
	) {
		$place = $fact->getPlace();
		if(!$place->isEmpty()) {
			$iconPlace= $mapProvider->getPlaceIcon($place);	
			if($iconPlace && strlen($iconPlace) > 0){
				return	'<div class="fact_flag">'. self::htmlPlaceIcon($place, $iconPlace, 50). '</div>';
			}
		}
		return '';
	}
347053
public function collect(Map $map, array $symbols = [])
    {
        foreach ($this->markerCollector->collect($map) as $marker) {
            if ($marker->hasSymbol()) {
                $symbols = $this->collectValue($marker->getSymbol(), $symbols);
            }
        }

        foreach ($this->iconSequenceCollector->collect($map) as $icon) {
            $symbols = $this->collectValue($icon->getSymbol(), $symbols);
        }

        return $symbols;
    }
1199969
private function getMarkerCluster(Map $map)
    {
        $markerCluster = $map->getOverlayManager()->getMarkerCluster();

        if ($markerCluster->getType() === MarkerClusterType::MARKER_CLUSTERER) {
            return $markerCluster;
        }
    }
291302
public static function typeMap(array $map = null, $merge = true)
    {
        if (is_array($map)) {
            static::$typeMap = $merge && static::$typeMap
                ? $map + static::$typeMap : $map;
        }

        return static::$typeMap;
    }
141572
public function staticMapLink($title, array $mapOptions = [], array $linkOptions = []) {
		return $this->Html->link($title, $this->staticMapUrl($mapOptions + ['escape' => false]), $linkOptions);
	}
1060248
public function collect(Map $map, array $markers = [])
    {
        return $this->collectValues($map->getOverlayManager()->getMarkers(), $markers);
    }
1251662
int mapPosition(int position) {
		int out = position;
		for (int delta : positionDeltas.headMap(position, true).values()) {
			out += delta;
		}
		return out;
	}
970756
private static void showMapDetails(Map<URL, MatchResult> map) {
        for (Entry<URL, MatchResult> entry : map.entrySet()) {
            log.info("Match " + entry.getKey().toString() + NL);
        }
    }
742041
public static <A, B> B safeLookup(Map<A, B> map, A key) {

        if (map == null) {
            return null;
        }
        return map.get(key);
    }
719632
protected void writeMap(Map<?, ?> map, CharBuf buffer) {
        if (map.isEmpty()) {
            buffer.addChars(EMPTY_MAP_CHARS);
            return;
        }
        buffer.addChar(OPEN_BRACE);
        for (Map.Entry<?, ?> entry : map.entrySet()) {
            if (entry.getKey() == null) {
                throw new IllegalArgumentException("Maps with null keys can\'t be converted to JSON");
            }
            String key = entry.getKey().toString();
            Object value = entry.getValue();
            if (isExcludingValues(value) || isExcludingFieldsNamed(key)) {
                continue;
            }
            writeMapEntry(key, value, buffer);
            buffer.addChar(COMMA);
        }
        buffer.removeLastChar(COMMA); // dangling comma
        buffer.addChar(CLOSE_BRACE);
    }
1333250
public function getItem(int $position): ?APIItem
    {
        foreach ($this->items as $item) {
            if ($item->getPosition() === $position) {
                return $item;
            }
        }

        return null;
    }
298317
protected static function translate($string, $map)
    {
        $out = '';
        foreach (range(0, strlen($string) - 1) as $i) {
            $out .= !empty($map[$i]) ? $map[$i] : $string[$i];
        }

        return $out;
    }
1015013
public function encodeMap(Map $map, Encoder $encoder)
    {
        $output = $encoder->getOutput();
        $hash   = spl_object_hash($map);

        if (!isset($this->initialized[$hash])) {
            $output->prepend(
                sprintf(
                    '%s = L.map(%s);',
                    $encoder->encodeReference($map),
                    $encoder->encodeArguments(array($map->getElementId(), $map->getOptions()))
                )
            );

            $this->initialized[$hash] = true;
        } else {
            foreach ($map->getControls() as $control) {
                $encoder->encodeReference($control);
            }

            foreach ($map->getLayers() as $layer) {
                $encoder->encodeReference($layer);
            }

            $output->append($this->encodeMethodCalls($map->getMethodCalls(), $encoder));
        }
    }
228780
public function mapParams(array $map, $params = null)
    {
        if (!isset($params)) {
            $params = $this->params;
        }

        $mapped = array();

        foreach ($params as $key => $value) {
            if (isset($map[$key]) && is_string($map[$key])) {
                gplcart_array_set($mapped, $map[$key], $value);
            }
        }

        return $mapped;
    }