Select to view content in your preferred language

Angular 17 would not start the server

145
0
01-14-2025 06:11 AM
Thumo
by
Emerging Contributor

Good day everyone,

I am creating angular 17 app, after install esri js module, i get an error; " X [ERROR] No loader is configured for ".svg" files: node_modules/@arcgis/core/assets/esri/themes/base/images/Loading_Indicator_double_32.svg"

 

I have tried to install @angular-builders/custom-webpack, but its not working; below is typescript component

 

 

 

import { Component, OnInit } from '@angular/core';
import Map from '@arcgis/core/Map';
import MapView from '@arcgis/core/views/MapView';

@Component({
selector: 'app-cluster',
templateUrl: './cluster.component.html',
styleUrls: ['./cluster.component.css'],
})
export class ClusterComponent implements OnInit {
constructor() {}

ngOnInit(): void {
// Initialize the ArcGIS Map
const map = new Map({
basemap: 'topo-vector', // Options: 'streets', 'satellite', 'hybrid', etc.
});

const view = new MapView({
container: 'arcgis-map', // This references the div with id="arcgis-map"
map: map,
center: [34.8516, 31.0461], // Longitude, Latitude (example: Israel coordinates)
zoom: 10, // Zoom level
});
}
}
import { Component, OnInit, AfterViewInit } from '@angular/core';
import '@arcgis/core/assets/esri/themes/light/main.css';
import WebMap from "@arcgis/core/WebMap";
import MapView from "@arcgis/core/views/MapView";


@Component({
  selector: 'app-maps',
  templateUrl: './maps.component.html',
  styleUrls: ['./maps.component.css']
})
export class MapsComponent implements OnInit, AfterViewInit {

  constructor() { }

  ngOnInit(): void {
            his.initializeMap();
  }

  ngAfterViewInit(): void {
initialized
    this.initializeMap();
  }

  initializeMap(): void {
    // Create a new WebMap
    const webMap = new WebMap({
      portalItem: { id: 'f' } 
    });
    const mapView = new MapView({
      container: 'mapViewDiv',
      map: webMap 
    });

    mapView.when(() => {
      console.log('Map and View are ready');
    });
  }

}

 

 

Tags (1)
0 Kudos
0 Replies