Fill Map Via DB Feed

Permalink Browser Info Environment
Hi There,
Just installed your add-on, looks very good, thx. for that good work.

As we are a company that develop/sell IoT solutions to measure Air Quality, humidity etc... we would like to populate the map with our sensor locations which are stored in a database.
So any information/coding example, hints or how-to you could pass to us so that we can program/add this feature ?

The fixed manual grouping & location does not work for us, we would like to populate this based on the logged-in user ID which is connected to a contract so that the user can only see his sensors.

Many thanks,
Walter Verhoeven

Type: Discussion
Status: Resolved
dewav
View Replies:
mesuva replied on at Permalink Reply
mesuva
Hi Walter,

the database table that is used to store the map locations is really quite simple, it's called MsvLocationMapLocation. My suggestion would be to simply write some sort of script that fetches the data from your sensor locations database and populates this table. This could potentially be done with an Automated job.

For the filtering to the logged in user, this would require some direct changes to the block, as well as a new field to store the user_id. But I don't believe these would be difficult to make.

What I don't know is your technical background - whether you'd be happy to tackle these things, are if you are needing assistance.

(I'm travelling over the next few days, so my replies may be delayed)

Cheers
-Ryan
dewav replied on at Permalink Reply
dewav
Dear Ryan,

Thanks for your swift reply. In fact I already wrote a PHP page that shows my sensors in Google Maps but I had issues running it via the HTML block as that does not execute PHP code. So that's why I was looking at your great add-on. In the mean time I found out that we can add my page via the Single Page feature of Concrete5. So bottom_line I found my solution.

So for the moment I will not use your add-on but thanks for the hint on the table content, I can populate that with my data, that will be no problem. The user on the other hand would need some extra coding so if you can share me your thoughts on how to achieve that, would be great !

I am a also a programmer so that would work for me.

BIG thanks,
Walter Verhoeven

concrete5 Environment Information

# concrete5 Version
Core Version - 8.4.3
Version Installed - 8.4.3
Database Version - 20180716000000

# concrete5 Packages
Fundamental (4.0.6), Location Map (1.0.9), Login Block (0.9.3)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache/2.4.10 (Fedora) PHP/5.5.26

# Server API
apache2handler

# PHP Version
5.5.26

# PHP Extensions
apache2handler, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mhash, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, shmop, SimpleXML, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.