@param GeoJsonLayer $geoJsonLayer
@param Map          $map

@return string
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(),
        ]);
    }
451864
function (layer) {
		if (!this.hasLayer(layer)) {
			return this;
		}
		if (layer in this._layers) {
			layer = this._layers[layer];
		}

		layer.removeEventParent(this);

		var id = L.stamp(layer);

		if (this._map && this._layers[id]) {
			// Use the original map removeLayer.
			this._map._originalRemoveLayer(this._layers[id]);
		}

		delete this._layers[id];

		return this.fire('layerremove', {layer: layer});
	}
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));
        }
    }
271313
function(map) {
        OpenLayers.Control.prototype.setMap.apply(this, arguments);
        var i, layers = this.layers || map.layers;
        for (i=layers.length-1; i>=0; --i) {
            this.addLayer({layer: layers[i]});
        }
        if (!this.layers) {
            map.events.on({
                addlayer: this.addLayer,
                removeLayer: this.removeLayer,
                scope: this
            });
        }
    }
986296
public function addTo(Map $map)
    {
        $this->map = $map;
        $map->addLayer($this);

        return $this->addMethod('addTo', array($map));
    }
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),
        ]));
    }
983817
public function render(Map $map)
    {
        return $this->renderHtml($map).$this->renderStylesheet($map).$this->renderJavascript($map);
    }
1023569
function (layer) {
		var id = this.getLayerId(layer);

		this._layers[id] = layer;

		if (this._map) {
			this._proxyMcgLayerSupportGroup.addLayer(layer);
		} else {
			this._proxyMcgLayerSupportGroup.checkIn(layer);
		}

		return this;
	}
887784
function appendLayer( &$imageLayer, $parameters = array() )
    {
        if ( !$imageLayer instanceof eZImageLayer )
        {
            eZDebug::writeWarning( 'Only eZImageLayer objects may be added as layer items', __METHOD__ );
            return false;
        }
        ++$this->ImageLayerCounter;
        $layerID = $this->ImageLayerCounter;
        $this->ImageLayers[] = $layerID;
        $this->ImageLayerIndex[$layerID] = array( 'image' => &$imageLayer,
                                                  'parameters' => $parameters );
        return $layerID;
    }
492262
function doGeojson(g) {
    console.log("GEOJSON",g);
    if (!basemaps["geojson"]) {
        var opt = { style: function(feature) {
                var st = { stroke:true, color:"#910000", weight:2, fill:true, fillColor:"#910000", fillOpacity:0.3 };
                if (feature.hasOwnProperty("properties")) {
                    console.log("GPROPS", feature.properties)
                }
                if (feature.hasOwnProperty("style")) {
                    console.log("GSTYLE", feature.style)
                }
                return st;
            }
        }
        opt.onEachFeature = function (f,l) {
            if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
        }
        overlays["geojson"] = L.geoJson(g,opt);
        layercontrol.addOverlay(overlays["geojson"],"geojson");
    }
    overlays["geojson"].addData(g);
}
607742
function(map) {
    var self = this;
    this.options.map = map;

    // Add cartodb logo
    if (this.options.cartodb_logo != false)
      cdb.geo.common.CartoDBLogo.addWadus({ left:8, bottom:8 }, 0, map._container);

    this.__update(function() {
      // if while the layer was processed in the server is removed
      // it should not be added to the map
      var id = L.stamp(self);
      if (!map._layers[id]) {
        return;
      }

      L.TileLayer.prototype.onAdd.call(self, map);
      self.fire('added');
      self.options.added = true;
    });
  }
410320
public function render(Map $map)
    {
        return $this->getFormatter()->renderObjectCall(
            $map,
            'fitBounds',
            [$map->getBound()->getVariable()]
        );
    }
160252
static function fromJson(object $map): self {
    return new static(
      isset($map->head) && is_object($map->head) ? GitCommit::fromJson($map->head) : null,
      isset($map->branch) && is_string($map->branch) ? $map->branch : '',
      isset($map->remotes) && is_array($map->remotes) ? array_map([GitRemote::class, 'fromJson'], $map->remotes) : []
    );
  }
32690
static function fromJson(object $map): self {
    return (new static(isset($map->id) && is_string($map->id) ? $map->id : '', isset($map->message) && is_string($map->message) ? $map->message : ''))
      ->setAuthorEmail(isset($map->author_email) && is_string($map->author_email) ? $map->author_email : '')
      ->setAuthorName(isset($map->author_name) && is_string($map->author_name) ? $map->author_name : '')
      ->setCommitterEmail(isset($map->committer_email) && is_string($map->committer_email) ? $map->committer_email : '')
      ->setCommitterName(isset($map->committer_name) && is_string($map->committer_name) ? $map->committer_name : '');
  }
186481
function(map) {
        if (this._destroyed || !OpenLayers.Layer.Grid) {
            return;
        }
        this.maps.push(map);
        this.tileQueue[map.id] = [];
        for (var i=0, ii=map.layers.length; i<ii; ++i) {
            this.addLayer({layer: map.layers[i]});
        }
        map.events.on({
            move: this.move,
            zoomend: this.zoomEnd,
            changelayer: this.changeLayer,
            addlayer: this.addLayer,
            preremovelayer: this.removeLayer,
            scope: this
        });
    }
204508
function getCommonBaseLayers(map){
    var osmLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
    });
    var bathymetryLayer = L.tileLayer.wms("http://ows.emodnet-bathymetry.eu/wms", {
        layers: 'emodnet:mean_atlas_land',
        format: 'image/png',
        transparent: true,
        attribution: "EMODnet Bathymetry",
        opacity: 0.8
    });
    var coastlinesLayer = L.tileLayer.wms("http://ows.emodnet-bathymetry.eu/wms", {
        layers: 'coastlines',
        format: 'image/png',
        transparent: true,
        attribution: "EMODnet Bathymetry",
        opacity: 0.8
    });
    var bathymetryGroupLayer = L.layerGroup([bathymetryLayer, coastlinesLayer]);    
    bathymetryGroupLayer.addTo(map);
    return {
        "EMODnet Bathymetry": bathymetryGroupLayer,
        "OSM": osmLayer
    };
}
12228
protected function write($map, $fileName)
    {
        $content = json_encode($map, JSON_PRETTY_PRINT);

        if (!file_exists($fileName)) {
            file_put_contents($fileName, $content);
            return;
        }

        $oldContent = file_get_contents($fileName);
        // prevent file lastModified time change
        if ($content !== $oldContent) {
            file_put_contents($fileName, $content);
        }
    }