Loading...
 
Features / Usability

Features / Usability


Map tracker fields

United Kingdom

Hi,

I'm following this guide on creating a map:

https://doc.tiki.org/Pluginmap

The map code that I'm looking per example is this:

()


{searchlayer tracker_field_theRidgewayMap="y" tracker_field_publishBoundaryZoneSeparately="yes" maxRecords="200" popup_height="300" popup_width="480" }
{searchlayer tracker_field_theRidgewayMap="y" tracker_field_publishPathsSeparately="yes" maxRecords="200" load_delay="2" popup_height="300" popup_width="300"}
{searchlayer tracker_field_theRidgewayMap="y" tracker_field_publishPOISeparately="yes" maxRecords="200" load_delay="3" popup_height="300" popup_width="360"}

{|CODE}

How does one go about creating a tracker for this?

I have put something similar onto one of my pages but I'm getting an error:

Field tracker_field_MyField does not exist in the current index. Please check field permanent name and if you have any items in that tracker.

What type of field do I need? I'm looking through here: https://doc.tiki.org/Unified-Index but I'm a little confused.

Tiki version is 19.0. Thanks.


United Kingdom

Many thanks.

What would I use as the field type?

For POI I'm guessing it would be icon but what about BoundaryZoneSeparately ? Would that be Geographic Feature??


United Kingdom

I think I understand a little bit more now but it still isn't enough to get the overlays displaying as per the example.

This what I have done:

Created a tracker with these fields of type "checkbox": publishPOISeparately, publishBoundaryZoneSeparately

I created an entry in the tracker and set both fields to "yes".

Unfortunately I could not create the name field as there doesn't seem to be a type of "name" any more...?

I am then using this to generate the map and hopefully what will be a boundary and pointer for the location:


(scope="center" controls="controls,layers,levels,navigation,scale,coordinates,search_location" width="630" height="500" center="x,y,z" popupstyle="bubble" tooltips="y")}
{searchlayer geo_located="y" tracker_field_Name="y" maxRecords=100 tracker_id="3" load_delay="2" type="trackeritem" tracker_field_publishPOISeparately="yes"}
{searchlayer geo_located="y" tracker_field_Name="y" maxRecords=100 tracker_id="3" load_delay="3" type="trackeritem" tracker_field_publishBoundaryZoneSeparately="yes"}


...I am just using xyz here as example coordinates, though I have longitude,latitude and zoom levels set correctly.

The result is just a plain map??

This part of guide is a little confusing:

Boundaries: A name field, a files field (option index as maplayer GeoJSON) and a yes/no field (so the plugin know you want it displayed)
POI (Point Of Interest): A name field, an icon, a field a location field and a yes/no field (so the plugin know you want it displayed)
Path: A name field, a files field (option index as maplayer GeoJSON) and a yes/no field (so the plugin know you want it displayed)


Does this mean that I have to create different tracker items of same name, eg. "publishBoundaryZoneSeparately" but of different type?

So something like:

publishBoundaryZoneSeparately - type 'name'
publishBoundaryZoneSeparately - type 'files'
publishBoundaryZoneSeparately - 'checkbox'

Czech Republic

Hi Kaya,
not sure but I think there never was "name" type field but it is simply meant to be a "Name" labelled field of type "text". It seems the documentation is a bit confusing in that part indeed.
What you need to have created are 3 trackers with those fields. One to store the Boundaries data as items, second to store the POI data (Points of Interest) and the third one to store the Path data.

Is that more clear now?

luci



United Kingdom

Thanks Bernard!

Unfortunately I am still confused about how to build the tracker for it. :-(

From the source around line 291:

<div id="page-data" class="clearfix">
										<div class="map-container" data-marker-filter="Center" data-map-controls="controls,layers,levels,streetview,navigation,coordinates,search_location" data-popup-style="bubble" style="width: 100%; height: 100%;"  data-geo-center="-3.205,51.504,12" ><form method="post" action="tiki-searchindex.php" class="search-box onload" style="display: none" data-result-refresh="" data-result-layer="" data-result-suffix="" data-load-delay="">
	<p><input type="hidden" name="filter~tracker_field_cardiffMap" value="y"/><input type="submit" class="btn btn-default btn-sm" /></p>

</form><form method="post" action="tiki-searchindex.php" class="search-box onload" style="display: none" data-result-refresh="" data-result-layer="" data-result-suffix="" data-load-delay="1">
	<p><input type="hidden" name="filter~tracker_field_publishedOnTheMap" value="y"/><input type="submit" class="btn btn-default btn-sm" /></p>

</form></div>


I can see the tracker fields, also from line 715:

jqueryTiki.iconset = {"defaults":["500px","adjust","adn","align-center","align-justify","align-left","align-right","amazon","ambulance","anchor","android","angellist","angle-double-down","angle-double-left","angle-double-right","angle-double-up","angle-down","an....


the icons are listed.

But how do you create the trackers?

Taking the Boundary box as example. The Checkbox type turns the tracker field on or off -> so that means: tracker_field_publishBoundaryZoneSeparately="yes"

One would create a tracker with field type Checkbox and call it: publishBoundaryZoneSeparately

Then I am lost...

What I am not understanding is not the actual map side of things but the tracker side it seems; basically, what type of fields I would need and the data to be put inside them. That part isn't documented which is why I am having issues as there is no example to follow.


United Kingdom

Now I understand a little bit more from reading over again... In the worked example here: https://doc.tiki.org/PluginMap

it uses 3 trackers. As I don't need the "Paths" searchlayer this is what I've done so far which also shows how far I understand:

I have a tracker id: 3 with name: Location

There is a field in there of Type "Location" . Also "Use as item location" Option is set to "yes". I have created an Item here with the "To My Location" coordinates set to the Location I need.

I then created a tracker id: 4 with name: Boundaries

This has field of Type "Checkbox" with name "publishBoundaryZoneSeparately"

Last a tracker id: 5 with name: POI

Again it has field Type "Checkbox" and name "publishPOISeparately"

I am then building the map like this:

{MAP(scope="center" controls="controls,layers,levels,navigation,scale,coordinates,search_location,current_location,streetview,overview" width="630" height="500" center="X,Y,Z" popupstyle="bubble" tooltips="y")} 
{searchlayer geo_located="y" tracker_field_MyLocation="y" tracker_id="3" type="trackeritem" }
{searchlayer geo_located="y" maxRecords=100 tracker_id="4" load_delay="1" tracker_field_publishBoundaryZoneSeparately="yes" }
{searchlayer geo_located="y" maxRecords=100 tracker_id="5" load_delay="2" type="trackeritem" tracker_field_publishPOISeparately="yes"} {MAP}


However, outside of the basic map nothing is displayed??

What is even more confusing is that in the tracker Location I have marker displayed where my coordinates point to but they are not appearing on the map?

I'm missing something and doing something wrong but I just can't tell what it is....


Israel

I don’t understand what you did.

If you have only areas / boundaries that will be placed over your map and markers to display, then you need 2 trackers.

One tracker for the boundaries with 3 fields (minimum); name (text any label), zone (file for the json) and a checkbox (display yes or no).

Another tracker for the markers with 3 fields (minimum); name (text any label), icon (I used the icon field but I think it should also work with files) and a checkbox (display yes or no).

Then in the plugin map you use the checkboxes flag to display or not.

Be aware that you need to re-index you Tiki a lot (I do for each change :-D)


Kaya, sometimes a working example does miracles in the field of understanding. If you are able too, you may want to load up another instance of tiki for a test, and activate the "Cartograph" profile. Once you have that up and running, you can view the trackers and how they are configured and work.

United Kingdom

Well the Indexing issue is fixed :-) ...and I rebuilt the tracker.

Tracker:

locationNamepublichBoundaryZoneBoundaryJson
Type: TxtType: CheckboxType: File
val: locationName geo.json


I created the json file from here: http://geojson.io

This is all as Bernard's instructions :-)

Now I'm building map like this:

{MAP(scope="center" controls="scale,coordinates" width="630" height="500" center="X,Y,Z" popupstyle="bubble" tooltips="y")} 
{searchlayer  tracker_field_locationName="y" maxRecords=100 tracker_id="6"   tracker_field_publishBoundaryZone="yes" }
 {MAP}


No Boundary is being displayed??


United Kingdom

I just got an email response but nothing is showing up here unfortunately. Thanks Luci for the pointers!! Yes a lot clearer and I think I have understood correctly now how the map feature functions :-)

Based on my posting above I only created the Boundary tracker and pulled that into the map. This should work fine as everything is correct.

I think the reason why nothing has shown up maybe related to an OpenLayer issue. I made a quick test by attempting to Geo Locate a Wiki page: https://doc.tiki.org/Geolocation

I tried to enter different values for the Location part: City, Postal/Zip Code, Country

Each time I ended up in the middle of the sea...?? Big blue screen, of which when zoomed out showed no markers at all on the map.

I am wondering if there is a way to debug the OpenLayer interaction?

Also another strange thing, when I checked: System -> Control Panel -> File Gallery -> Index , the system claims that image/png and image/jpeg MIME values are not supported.
The cache has been cleared and of course GD and ImageMagick are both installed.
Additionally under the Control Panel -> Server Check I get this error:

The GD extension is loaded, and Tiki can create images, but the FreeType extension is needed for CAPTCHA text generation.

but FreeType is installed ????

To me it seems like there is a little more here then meets the eye if I could just figure out how to debug everything....


Israel

Kaya, I kindly suggest to participate at our next [https://tiki.org/Tiki-Online-Open-Hours | Tiki Online Open Hours session so we can help you using your real life Tiki.

Note that exceptionally this Thursday we are also doing a dogfood marathon and depending of the time decided by the volunteers there will be (or not) a TOOH... or may be they will be in parallel.

Did you considered hiring one of our Tiki Consultants ?


United Kingdom

Thanks Bernard, I will do my best to be there.

I think mainly things just stem from the fact that I'm using a non-orthodox environment: FreeBSD Jail, Nginx, php7.3

Of course all prereqs are installed however, for some reason the Server Check doesn't detect many of them? It might be because the default install path is /usr/local/bin on my system.

But I think that this is good for a) learning and b) if there are issues to iron them out. :-)


Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.