How do you programmatically place text drawing graphic?
-
So we were able to import GraphicsLayerUtils and call AddGraphicToLayer(). But we can't figure out how to enable the Edit tool so we can then edit and move those text symbols. If we drop our custom text symbols in the "Drawings" layer then use the OOTB Text tool or Point tool, etc to place any drawing, the edit tool is enabled! Then we can use the edit tool to modify our text symbols too! So what is the secret flag or method or property we have to set to enable the Edit tool!?!?! 0 -
Can someone tell us if this is correct?
We were able to figure out that we could use this code to enable the edit tools:
this.app.toolRegistry.setActiveTool("EditMarkupTool");
this.app.toolRegistry.tool("EditMarkupTool").enabled.set(true);
this.app.toolRegistry.tool("DeleteMarkupTool").enabled.set(true);
this.app.toolRegistry.tool("EraseMarkupTool").enabled.set(true);
Now the user can edit the text labels placed by our custom tool after it creates them!0 -
@JOSH:
How do you invoke the "this.app.toolRegistry.tool..." from within a workflow?
Is it via a "RunExternalCommand" activity?
I have found a way to draw text on the map, but not hook it within the mark-up group (where end-users could later edit/move it)0 -
We had to give up on using a workflow for this tool because the user form lacks the ability to change the values in a 2nd drop down list based on the values from a different data structure. It only supports cascading and that is only for doing queries on tables in the DB. We needed a drop down with layer names and a drop down with field names from the layer selected in the first drop down. So we went with the Typescript custom module route. We then registered our custom module in the REST Manager as a new "I want to" menu item to actually execute it. Now it works great! We just need to figure out which CSS style to apply to our view.html form items to make it look like the user forms normally do...
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000fyc2&feoid=Body&refid=0EMf2000000kAd0" _/_img_0 -
There is a command which takes a point geometry call 'AddTextMarkup'. This will present a dialog the same way that the product does and adds it to the map. The command wraps a private method called _addTextMarkupImpl which does the actualy adding of the geometry and text.
This private method adds a graphic with a text markup symbol to the markup layer.0 -
.. I don't suppose we're allowed to type multi-line text (insert a CRLF)? My users need to add 3 lines of text .. and it is a painful, messy process to add 3 single-line texts under each other.. (and I hear them swear at the computer when they have to change the font/colour for each of the texts separately). 0 -
@josh : The trick here is to insert a text into the Geocortex markup layer (thus making it editable & deletable/re-style), just like any other mark-up or distance created by the default tool. I am going to guess that it has to be a point feature with a text label attached to iy.
I have managed to write text on the map using a workflow, but not hook them in as part of the normal set of mark-ups (not editable, not deletable). There _has_ to be a way to insert text features into the Mark-up layer.
0 -
In order for a custom markup to be added to be inclided in the OOTB editing markup tools. Add the markup to the Drawing layer which the markup module uses.
Then call ->
this.app.event("MarkupAddedEvent").publish(theMarkupGraphic);
this.app.command("ClearMarkup").raiseCanExecuteChanged();
this.app.command("EditMarkup").raiseCanExecuteChanged();
this.app.command("DeleteMarkup").raiseCanExecuteChanged();
this.app.command("ExportMarkupLayer").raiseCanExecuteChanged();
This refreshed the tool and toolbar items.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
8 Kommentare