POST
|
Hi Shay, I used the Font class in conjunction with the TextSymbol class from the API library as is done in this example. However, the TextSymbol displayed in the ESRI example does not carry the font styling in a tspan div. In the ESRI example the html for the text symbol looks like this: <text fill="rgb(0, 0, 0)" fill-opacity="1" stroke="none" stroke-opacity="0" stroke-width="1"
stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4" x="315" y="184"
text-anchor="middle" text-decoration="undefined" rotate="0" kerning="auto"
text-rendering="optimizeLegibility" font-style="normal" font-variant="normal"
font-weight="bolder" font-size="40" font-family="Impact,Arial" dominant-baseline="alphabetic"
transform="matrix(1.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000)"
fill-rule="evenodd">X: -13,047,355.689, Y: 4,035,635.357</text> I'm not sure why my implementation is carrying the font-family property in a tspan element. Thanks, Tyler
... View more
08-29-2019
04:45 AM
|
0
|
1
|
1427
|
POST
|
Greetings, I'm working on a labeling tool that allows the user to set the font family, size, weight variant and style of label before adding it to the map as a graphic's text Symbol. I can set every one of those properties except for the font family. The font family for thegraphic is always set to "'Helvetica Neue',Helvetica,Arial,sans-serif" no matter what value I put into the "font.setFamily()" method. I have a couple of questions. First where is an authoritative list of fonts values that can be passed to the "font.setFamily()" method. Next, once you have those values, how do you get a graphic's text symbol to display those fonts? I'm assigning the properties of my font like this: let font = new Font();
font.setVariant(Font.VARIANT_NORMAL);
font.setWeight(Font["WEIGHT_BOLDER"]);
font.setFamily("impact");
font.setStyle(Font["STYLE_OBLIQUE"]);
font.setSize(20);
let textSymbol = new TextSymbol(notes, font, color);
let textJSON = textSymbol.toJson();
let labelg = new Graphic(graphic.geometry, textSymbol, graphic.attributes);
console.log(labelg.symbol.toJson());
layer.add(labelg); When I check out the console.log of labelg.symbol.toJson() at this point I get : {size: 15, style: "oblique", weight: "bolder", family: "impact"} . Except for the font size being 15 rather than 20, this is pretty much what I expect. However, when the graphic loads, it is clearly not impact. Upon right clicking on the label in the map and selecting the 'Inspect' menu option to see the HTML of the label in the developer console I see the folowing: <text fill="rgb(0, 0, 0)" fill-opacity="1" stroke="none" stroke-opacity="0"
stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4"
x="196" y="394" text-anchor="middle" text-decoration="undefined" rotate="0"
kerning="auto" text-rendering="optimizeLegibility" font-style="oblique"
font-variant="normal" font-weight="bolder" font-size="20" font-family="impact,Arial"
dominant-baseline="alphabetic"
transform="matrix(1.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000)"
fill-rule="evenodd">
<tspan dy="0" x="196" letter-spacing="1px"
font-family="'Helvetica Neue',Helvetica,Arial,sans-serif">
Courier New, 20, B, I
</tspan>
</text> The 'font-family' property in the text element is set to 'impact,Arial', however it appears to me that the tspan element is the element that actually styles the font in the map. The tspan element's font-family is set to "'Helvetica Neue',Helvetica,Arial,sans-serif". If I change the tspan's font-family property to 'impact' in the developer console then the font family displays correctly in the map. How do I get the tspan's font-family set correctly using the JavaScript API? Thanks, Tyler
... View more
08-28-2019
08:09 AM
|
0
|
3
|
1671
|
POST
|
Thanks Russell Roberts, I will check this process this weekend and report back to you the results. Thank you for this information. Tyler
... View more
02-27-2019
05:15 PM
|
0
|
0
|
592
|
POST
|
Hi Biraja Nayak, Thank you for the suggestion. I will try to recreate this this weekend and report back to you with the results. Thanks, Tyler
... View more
02-27-2019
05:13 PM
|
0
|
0
|
849
|
POST
|
That was it. I don't believe that the optimization settings have an effect on the font size. To change the font size I went back to the ArcGIS Vector Tile Style Editor (beta) and edited my vector tile layer. In the style editor click the 'Edit Layer Styles' menu and hammer away. Lots of clicking but the outcome looks great. It would be awesome to be able to output the JSON file and edit it in a text editor.
... View more
02-20-2019
06:20 PM
|
0
|
2
|
2323
|
POST
|
Thanks for the info Russell Roberts. Initially I had the slider set at 'balanced' and switching to 'performance' actually did increase the font size in the web scene but not in my web application. Per your instruction I set the optimization to 'quality' and the font size in the web scene did not increase at all compared to the 'balanced' setting. None of these setting have any effect on the font size in my web application. I see that in the ArcGIS Vector Tile Style Editor (beta)(where I created my vector tiles), there is a a layers button where you can go in and alter all of the label sizes. Is this the best way to do this? It would be really cool to be able to edit them directly in the JSON. Is there a way to extract the JSON, edit it and then load it back into ArcGIS Online? Is altering the the font size in the vector tile editor the best way to go or is there a quicker way? thanks for all the info, Tyler
... View more
02-20-2019
05:42 PM
|
0
|
3
|
596
|
POST
|
Greetings, I've written a react application that requires a SceneView. About every 20th refresh the application maxes out my memory and crashes. I can write the whole application with a MapView instead and everything is fine. I also get an error each time I load the SceneView: [esri.core.Accessor] Accessor#set Assigning an instance of 'esri.views.ui.DefaultUI' which is not a subclass of 'esri.views.ui.3d.DefaultUI3D' Does this error have anythign to do with the memory being maxed out every so often? The code I'm working with is : import React, { Component} from 'react'
import EsriLoaderReact from 'esri-loader-react'
import MapOverlayPanel from '../../molecules/MapOverlayPanel/MapOverlayPanel'
import './ESRIScene.css'
class ESRIScene extends Component {
constructor(props){
super(props)
this.state = {
SceneView: null
, searchResultGL:null
}
this.loadMap = this.loadMap.bind(this);
}
loadMap = ({loadedModules: [WebScene, SceneView, Locate, GraphicsLayer, DefaultUI], containerNode}) => {
const self = this
let map = new WebScene({
portalItem: { // autocasts as new PortalItem()
id: "a4d990eaeea64f62809e74f0d83a4ee2"
}
})
new SceneView({
container: containerNode
,id:'sv'
, map: map
, ui: new DefaultUI()
, camera: {
position: {
x: -117.185087,
y: 32.715736,
z: 300,
spatialReference: {
wkid: 4326
}
},
heading: 90,
tilt: 77.5
}
})
.when(function(view){
self.setState({SceneView: view})
view.ui.padding = { top: 96, left: 21, right: 21, bottom: 0 }
if (window.matchMedia("(min-width: 770px)").matches) {
view.ui.components=["zoom", "navigation-toggle", "compass"];
}
view.on('click', function(e){
console.log('thi click has arrived: ' + JSON.stringify(e.mapPoint));
})
let searchResultGL = new GraphicsLayer()
self.setState({searchResultGL:searchResultGL});
view.map.add(searchResultGL)
})
}
render() {
const options = {
url: 'https://js.arcgis.com/4.10/'
};
return (
<div className="ESRIScene">
<EsriLoaderReact
options={options}
modulesToLoad={['esri/WebScene', 'esri/views/SceneView', 'esri/widgets/Locate', 'esri/layers/GraphicsLayer', 'esri/views/ui/DefaultUI']}
onReady={this.loadMap}
/>
<MapOverlayPanel
ref ='mapOverlay'
sceneView={this.state.SceneView}
searchResultGL={this.state.searchResultGL}
resultPinDragable={true}
/>
</div>
);
}
}
export default ESRIScene; Any words of wisdom will be greatly appreciated. Thanks, Tyler
... View more
02-19-2019
04:14 PM
|
0
|
3
|
1122
|
POST
|
Russell Roberts, I've got it set to performance and it looks great in ArcGIS Online. When I view it in Chrome a chrome browser on my Ubuntu machine the text is tiny. It's a react application that I am hoping to deploy across all devices. Thanks, Tyler
... View more
02-19-2019
03:59 PM
|
0
|
5
|
1731
|
POST
|
Hi Russell Roberts, the performance -vs- quality slider was set in the middle. I moved it to 'performance' and saved but there is no difference in the application that I consume the scene in. Is there a way to adjust the font size? Thanks for your help. Tyler My map application ArcGISOnline WebScene
... View more
02-16-2019
08:19 AM
|
0
|
7
|
1731
|
POST
|
Hi Russell Roberts, Here is the link: Scene Viewer . Is there anything else that you need? Any ideas or suggestions will be greatly appreciated. Thanks, Tyler
... View more
02-14-2019
03:29 PM
|
0
|
9
|
1731
|
POST
|
It turns out this can be done. Create a little react component like this: import React from 'react'; class PopUpContent extends React.Component { render() { return ( <div> <p>Put your rad popup content here</p> </div> ); } } export default PopUpContent; Then put it in the ESRI popup like this: let puNode = document.createElement("div"); self.state.mapView.popup.content = puNode ReactDOM.render( <PopUp />, puNode ); I hope this helps someone.
... View more
01-28-2019
12:21 PM
|
2
|
4
|
3574
|
POST
|
Hi, I want to combine data from multiple sources and create my own buttons using a react component. Is there an easy way to replace the out of the box popup with a React component? Thanks, Tyler
... View more
01-25-2019
09:53 AM
|
0
|
6
|
4370
|
POST
|
Greetings Everyone, I have a vector tile draped over ground elevation in a WebScene (Scene Viewer ). It looks great when I design it in the Vector Tile Style Editor (ArcGIS Vector Tile Style Editor (beta) ) . However, in the Web Scene the labels are so small. I can barely ever read the labels and I designed the vector tiles with the 'large label' option. Has anyone ever dealt with this before and solved it? Do you know what multiplier to use on all the labels in the WebScene? Any recommendations will be greatly appreciated. Thanks, Tyler
... View more
01-08-2019
03:51 PM
|
0
|
13
|
2705
|
POST
|
Update: to troubleshoot this issue and factor out as many variables as possible, I decided to run a simpler GPServer tool - CreateBuffers. I used the featureCollection example referenced in the tool's documentation (Feature input—ArcGIS REST API: Spatial Analysis Service | ArcGIS for Developers ) for simplicity sake. Strangely, I ended up getting the same errors: esriJobMessageTypeError: {"messageCode": "AO_100012", "message": "CreateBuffers failed."} esriJobMessageTypeError: Failed to execute (CreateBuffers). esriJobMessageTypeError: Failed. I'm thinking that there must something other than the GPTask failing since the two required variables (inputLayer and distances) for CreateBuffers are either taken from the documentation (inputLayer) or are dirt simple (distances i.e. [4.0]). Is there something I should be checking for on the server? Following the Create Buffer documentation I created a request that looks like this in Chrome's HTTP Trace add-on: context: dissolveType: None distances: [4.0] endType: Round env:outSR: env:processSR: f: html field: inputLayer: { "layerDefinition": { "geometryType": "esriGeometryPoint", "fields": [ { "name": "Id", "type": "esriFieldTypeOID", "alias": "Id" }, { "name": "Name", "type": "esriFieldTypeString", "alias": "Name" } ] }, "featureSet": { "geometryType": "esriGeometryPoint", "spatialReference": { "wkid": 4326 }, "features": [ { "geometry": { "x": -104.44, "y": 34.83 }, "attributes": { "Id": 43, "Name": "Feature 1" } }, { "geometry": { "x": -100.65, "y": 33.69 }, "attributes": { "Id": 67, "Name": "Feature 2" } } ] }, "filter": "Name = 'Feature 1'" } outputName: returnM: false returnZ: false ringType: Disks sideType: Full units: Meters
... View more
02-09-2018
09:29 AM
|
0
|
0
|
1060
|
Title | Kudos | Posted |
---|---|---|
1 | 07-28-2016 03:05 PM | |
4 | 09-20-2017 11:37 AM | |
2 | 01-28-2019 12:21 PM | |
1 | 10-16-2017 12:56 PM | |
1 | 10-07-2014 07:04 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|