0

I'm using the Locate widget in my MapView using a self hosted 4.19 version. I followed the installation instructions but I just found out that it access arcgisonline.com to query the GeometryService REST API. I have a working ArcGIS Server with all the layers and services I need. How can I configure it to use my own GeometryService URL? Do I need to write my own Locate widget?

const locate = new Locate({
  view: view,
  useHeadingEnabled: false,
  goToOverride: function (view, options) {
    options.target.scale = 1500;
    return view.goTo(options.target);
  }
});
view.ui.add(locate, "top-left");

1 Answer 1

0

I found that you can override API defaults using the config module described in the documentation.

import esriConfig from "@arcgis/core/config";
esriConfig.geometryServiceUrl = "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer";

I would recommend setting fontsUrl too.

esriConfig.fontsUrl = "https://myserver.com/fonts";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.