Esri / esri-loader

A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications
Apache License 2.0
459 stars 79 forks source link

about dijit/Measurement #195

Closed waiwaiTaDady closed 4 years ago

waiwaiTaDady commented 5 years ago

when i use this dijit ,i lost the CSS,how to resolve this problem?thanks

componentWillMount(){ loadCss('http://localhost/arcgis_js_api/library/3.29/esri/themes/calcite/dijit/calcite.css'); loadCss('http://localhost/arcgis_js_api/library/3.29/esri/themes/calcite/esri/esri.css');//themes/calcite/esri/esri.css // desbugger // loadCss('3.29') }

lengthMeasure=()=>{
    var _this = this;
    var map = _this.props.mapControl;      
    esriLoader.loadModules([
        "dojo/dom",
        "esri/Color",
        "dojo/keys",
        "dojo/parser",

        "esri/config",
        "esri/sniff",
        "esri/map",
        "esri/SnappingManager",
        "esri/dijit/Measurement",
        "esri/layers/FeatureLayer",
        "esri/renderers/SimpleRenderer",
        "esri/tasks/GeometryService",
        "esri/symbols/SimpleLineSymbol",
        "esri/symbols/SimpleFillSymbol",

        "esri/dijit/Scalebar",
        "dijit/layout/BorderContainer",
        "dijit/layout/ContentPane",
        "dijit/TitlePane",
        "dijit/form/CheckBox",
        "dojo/domReady!"
    ],  {url : `${BASICCONFIG.GISAPI}/dojo/dojo.js`}).then(([
        dom, Color, keys, parser,
        esriConfig, has, Map, SnappingManager, Measurement, FeatureLayer, SimpleRenderer,
         GeometryService, SimpleLineSymbol, SimpleFillSymbol
    ])=>{
        map.graphics.clear();
        if (_this.mapClickEvent) {
            _this.mapClickEvent.remove();
            _this.mapClickEvent = null;
        }
        if (_this.props.mapControl.tb) {
            _this.props.mapControl.tb.deactivate();
            _this.props.mapControl.tb = null;
        }

        //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
        esriConfig.defaults.geometryService = new GeometryService("http://localhost/arcgis/rest/services/Utilities/Geometry/GeometryServer");

        var measurement = new Measurement({
        map: map
        }, dom.byId("measurementDiv"));
        measurement.startup();
    });
};

render() { return (

测距
    )
}
tomwayson commented 5 years ago

What CSS files do you see loaded in the network traffic?

waiwaiTaDady commented 5 years ago

What CSS files do you see loaded in the network traffic?

企业微信截图_15717923618763

arcgis api 3.29 dijit/measurement , i don‘t know how to set the style ,the css file was looaded but invalid

tomwayson commented 5 years ago

Have you read https://developers.arcgis.com/javascript/3/jshelp/css.html

tomwayson commented 5 years ago

also, I'd start by just loading the CSS using static <link>s in your HTML document. Once that works, you can then start looking into using loadCss().

jwasilgeo commented 4 years ago

@waiwaiTaDady were you able to get this resolved?

waiwaiTaDady commented 4 years ago

oh,thanks for attention about this.I did not find any good method to solve this problem,so....i take the most primitive method---using a Css cover the Measurement Css of ArcgisAPI ('Copy' the style).em.....you have some good solution?