Skip to content

Commit

Permalink
fix: remove all references to esri loader
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Nov 3, 2020
1 parent e2bed26 commit 20cf1a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/components/Identify/Identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import './Identify.css';
import { Container, Col } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import {project, isLoaded, isSupported, load} from '@arcgis/core/geometry/projection';
import Helpers from '../../Helpers';
import { loadModules } from 'esri-loader';

class IdentifyInformation extends Component {
state = {
Expand Down Expand Up @@ -302,16 +301,17 @@ class IdentifyInformation extends Component {
}

async projectPoint(mapPoint, srid) {
const [projection] = await loadModules(['esri/geometry/projection']);
// lat/long coords
console.log("loaded: ", projection.isLoaded());
console.log("supported: ", projection.isSupported());

await projection.load();
if (!isSupported) {
console.warn('projection not supported');
return;
}

console.log(projection.isLoaded());
// lat/long coords
if (!isLoaded()) {
await load();
}

return projection.project(mapPoint, { wkid: srid });
return project(mapPoint, { wkid: srid });
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/components/esrijs/Print.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import { loadModules } from 'esri-loader';

import Print from '@arcgis/core/widgets/Print';

export default class Printer extends Component {
render() {
Expand All @@ -10,8 +9,6 @@ export default class Printer extends Component {
}

async componentDidMount() {
const [Print] = await loadModules(['esri/widgets/Print']);

if (this.printer) {
return;
}
Expand Down

0 comments on commit 20cf1a5

Please sign in to comment.