<commit_before>/*!
 * Leaflet Zoom Component
 *
 * Copyright(c) <NAME> <<EMAIL>>
 * Licensed under MIT
 */

import { Component, OnInit, ViewChild, ElementRef, Renderer } from '@angular/core';
import { LeafletMapService } from '../leaflet-map.service';
import * as L from 'leaflet';

@Component({
  selector: 'app-leaflet-zoom',
  templateUrl: './leaflet-zoom.component.html',
  styleUrls: ['./leaflet-zoom.component.sass']
})
export class LeafletZoomComponent implements OnInit {
  public control: L.Control;

  @ViewChild('controlwrapper') controlWrapper: ElementRef;

  constructor(
    private _mapService: LeafletMapService,
    private _renderer: Renderer
  ) { }

  ngOnInit() {
    this.control = new (L as any).Control.Zoom();

    this._mapService
      .getMap()
      .then((map: L.Map) => {
        // add to the map
        this.control.addTo(map);

        // remove the default container
        this.control.getContainer().remove();

        let container = this.control.onAdd(map);

        // append the element container to the controlWrapper
        this._renderer.invokeElementMethod(this.controlWrapper.nativeElement, 'appendChild', [<commit_msg>Use renderer to remove the container of zoom control<commit_after>/*!
 * Leaflet Zoom Component
 *
 * Copyright(c) <NAME> <<EMAIL>>
 * Licensed under MIT
 */

import { Component, OnInit, ViewChild, ElementRef, Renderer } from '@angular/core';
import { LeafletMapService } from '../leaflet-map.service';
import * as L from 'leaflet';

@Component({
  selector: 'app-leaflet-zoom',
  templateUrl: './leaflet-zoom.component.html',
  styleUrls: ['./leaflet-zoom.component.sass']
})
export class LeafletZoomComponent implements OnInit {
  public control: L.Control;

  @ViewChild('controlwrapper') controlWrapper: ElementRef;

  constructor(
    private _mapService: LeafletMapService,
    private _renderer: Renderer
  ) { }

  ngOnInit() {
    this.control = new (L as any).Control.Zoom();

    this._mapService
      .getMap()
      .then((map: L.Map) => {
        // add to the map
        this.control.addTo(map);

        // remove the default container
        this._renderer.invokeElementMethod(this.control.getContainer(), 'remove');

        let container = this.control.onAdd(map);

        // append the element container to the controlWrapper
        this._renderer.invokeElementMethod(this.controlWrapper.nativeElement, 'appendChild', [
{'fraction_non_alphanumeric': 0.1285240464344942, 'fraction_numerical': 0.0, 'mean_word_length': 3.443830570902394, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222969', 'n_tokens_mistral': 713, 'n_tokens_neox': 696, 'n_words': 177}