Changeing the title by HTML or java script

Map Plus helps, usage, issues, bug report, downloads...

Changeing the title by HTML or java script

Postby Sterntaucher » 2019-03-15 9:58

Hello dear MapPlus team,

I'm trying to customize the edit fields to get both most flexibility and comfort.

To fit my needs in the field for survey issues I have to place values in different custom properties. So I used HTML and java script to show me the entry fields I need right in the item's pop up window placed onto the map (see attachment).

These edit fields work so far, and it's great that MapPlus can even change the label of the item automatically, depending on my entries. And here my question:

I want to change the title of the Item depending on the values of my entries. E.G. a result in numbers, or any pre-defined expression I like. Is that possible and how?

Another question: the length of the input fields for text can be controlled by "size='xx'. This doesn't work with input number fields. Is there a way to shorten number fields (In my example the field "Anz:")?

Thanks so much!!
Attachments
23EE4558-CF26-4427-8020-FC33B9754C9C.png
23EE4558-CF26-4427-8020-FC33B9754C9C.png (253.57 KiB) Viewed 39 times
User avatar
Sterntaucher
★★
 
Posts: 20
Joined: 2017-07-12 12:19

Re: Changeing the title by HTML or java script

Postby Zax » 2019-03-15 10:35

Sterntaucher wrote:I want to change the title of the Item depending on the values of my entries. E.G. a result in numbers, or any pre-defined expression I like.


You can add a custom property named "MYTITLE", then use javascript to edit its value while some input happens, for example:trigger following link to change both MYTITLE and COUNT at the same time:
Code: [Select all]
<script>
  function onInputNewValue(value) {
         var newTitle = "V-" + value;
         window.location.href = "mpps://updateproperty?MYTITLE="+ newTitle +"&COUNT=" + value;
  }
</script>
Javascript


For on map labels, you can enable icon label style and set a expression to use that TITLE property like: "Title:" + [MYTITLE]

Unlike custom properties, the system title of a feature does not have such flexibility so that you can't edit by html or js.

Question 2, the size of input field.
First, please notice the HTML rendering engine is fully from iOS, we did not invert our own, which means it should work exactly the same as Safari or similar web browser, following the latest HTML standards.

Second, please notice you don't have to specify the "type" of <input> as "number", it is not valid and acceptable in HTML standard which makes the rendering engine confused and so the "size" attribute is ignored. Please use "text" as the type for all input, the app could convert any input to its proper data type when save them to your user data, which is based on the data type setting of the custom property's meta data.

For more HTML styling and layout, please refer to some related documents, we're not experts on that.
For example: https://learn.shayhowe.com/

Please notice that Map Plus could use online CSS and JS library when making up the HTML. Actually, you can implement any styles and layouts same as any online websites, there is no limitation on that.
The only restriction for HTML in Map Plus is its should not have <head></head> and its sub elements.
Zax Zeng
Duwei Technology
User avatar
Zax
★★★★★
 
Posts: 1144
Joined: 2011-07-27 0:54

Re: Changeing the title by HTML or java script

Postby Sterntaucher » 2019-03-15 11:30

Hello Zax,

using "text" instead if "number" input fields works fine, I can shorten the field now to get some more space on the iPhone's screen now. Thanks so much!

Am I right, that a custom property called "MYTITLE" would not affect the feature's system title?

What I want to use are more general features in the quick menu, e.g. "Point: Bird" or "Point: Habitat".
In the first step I place it, and then I use the input form to set the species (e.g. "Blk" = Bluethroat) and other values:

05D9C4F6-510B-4821-A103-FE967689EBE8.png
Input fields for bird species
05D9C4F6-510B-4821-A103-FE967689EBE8.png (87.41 KiB) Viewed 35 times


When zooming out, the automatically generated labels can overlap:

C9B3A3B6-0805-4549-B508-D6CBC59C20CE.png
labels of nearby features can overlap
C9B3A3B6-0805-4549-B508-D6CBC59C20CE.png (404.58 KiB) Viewed 35 times


To choose the right feature, I tap on the bulk of features. As long as the title is not changed, all my points are listed with the same name ("Punkt: Vogel" = "Point: Bird"):

8A724D5B-DC17-4C6F-9DE4-073EE66135B5.png
List of features qith the same title
8A724D5B-DC17-4C6F-9DE4-073EE66135B5.png (254.3 KiB) Viewed 35 times


What can I do to distinguish them in the list after editing the species? Automatically changeing the title would be the easiest way. But maybe you got another idea, though.

Chears and thx,

Sterntaucher
User avatar
Sterntaucher
★★
 
Posts: 20
Joined: 2017-07-12 12:19

Re: Changeing the title by HTML or java script

Postby Zax » 2019-03-15 13:06

Sorry but the custom property of MYTITLE only brings you the ability and flexibility of editing with HTML and JS, but it could not affect the system title, which is totally isolated from the property system, could only be edited by manually editing in detail information, or data file importing with synchronization option turned on.

The names in list is system title and could not be assigned as a custom property.

We may adjust that design in future release.
Zax Zeng
Duwei Technology
User avatar
Zax
★★★★★
 
Posts: 1144
Joined: 2011-07-27 0:54

Re: Changeing the title by HTML or java script

Postby Sterntaucher » 2019-03-15 16:26

Zax wrote:We may adjust that design in future release.


That would be really great!

Maybe You can also think about my other requests concerning Distance rings / Bearing line and keeping the Zoom level / Map view when turning iOS Photos ON.

Thank You so much!

Sterntaucher
User avatar
Sterntaucher
★★
 
Posts: 20
Joined: 2017-07-12 12:19


Return to Map Plus - Forums

cron