Skip to content

Commit

Permalink
fix(sherlock): remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Jun 13, 2024
1 parent 5a45ad4 commit d3539e6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions packages/sherlock/src/Sherlock-InMap.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const FeatureService = ({ url, searchField, contextField }) => {
const [config, setConfig] = useState();

useEffect(() => {
console.log('init sherlock');

const map = new Map({ basemap: 'streets-night-vector' });
const view = new MapView({
container: mapDiv.current,
Expand Down
16 changes: 0 additions & 16 deletions packages/sherlock/src/Sherlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export default function Sherlock({
};

const itemToString = (item) => {
console.log('Clue:itemToString', arguments);

return item ? item.attributes[provider.searchField] : '';
};

Expand Down Expand Up @@ -212,7 +210,6 @@ function Clue({ clue, provider, maxResults, children }) {
};

const makeNetworkRequest = useCallback(async () => {
console.log('makeNetworkRequest');
const { searchField, contextField } = provider;

const response = await provider.search(clue).catch((e) => {
Expand Down Expand Up @@ -262,7 +259,6 @@ function Clue({ clue, provider, maxResults, children }) {
}, [clue, maxResults, provider]);

useEffect(() => {
console.log('clue or makeNetworkRequest changed');
updateState({
error: false,
loading: true,
Expand Down Expand Up @@ -336,7 +332,6 @@ class ProviderBase {

export class MapServiceProvider extends ProviderBase {
constructor(serviceUrl, searchField, options = {}) {
console.log('sherlock.MapServiceProvider:constructor', arguments);
super();

this.searchField = searchField;
Expand All @@ -359,17 +354,13 @@ export class MapServiceProvider extends ProviderBase {
}

async search(searchString) {
console.log('sherlock.MapServiceProvider:search', arguments);

this.query.where = this.getSearchClause(searchString);
const featureSet = await executeQueryJSON(this.serviceUrl, this.query);

return { data: featureSet.features };
}

async getFeature(searchValue, contextValue) {
console.log('sherlock.MapServiceProvider', arguments);

this.query.where = this.getFeatureClause(searchValue, contextValue);
this.query.returnGeometry = true;
const featureSet = await executeQueryJSON(this.serviceUrl, this.query);
Expand All @@ -381,7 +372,6 @@ export class MapServiceProvider extends ProviderBase {
export class WebApiProvider extends ProviderBase {
constructor(apiKey, searchLayer, searchField, options) {
super();
console.log('sherlock.providers.WebAPI:constructor', arguments);

const defaultWkid = 3857;
this.geometryClasses = {
Expand Down Expand Up @@ -414,17 +404,13 @@ export class WebApiProvider extends ProviderBase {
}

async search(searchString) {
console.log('sherlock.providers.WebAPI:search', arguments);

return await this.webApi.search(this.searchLayer, this.outFields, {
predicate: this.getSearchClause(searchString),
spatialReference: this.wkid,
});
}

async getFeature(searchValue, contextValue) {
console.log('sherlock.providers.WebAPI:getFeature', arguments);

return await this.webApi.search(
this.searchLayer,
this.outFields.concat('shape@'),
Expand Down Expand Up @@ -520,8 +506,6 @@ class WebApi {
// 'camel': camel cases all attribute names
//
// returns: Promise
console.log('WebApi:search', arguments);

var url = `${this.baseUrl}search/${featureClass}/${encodeURIComponent(
returnValues.join(','),
)}?`;
Expand Down

0 comments on commit d3539e6

Please sign in to comment.