Locator 3.5

Miscellaneous tools
Message
Author
User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#31 Post by Geoffrey »

Thanks guys, I tried to find the problem with Tahr a while back but gave up as I thought it was the way I was doing things, as MochiMoppel pointed out here.
MochiMoppel wrote:Everything is fine as long as you use absolute paths for your image. Relative paths seem to work only in browsers. Inkscape has the same limitation. Hardly a "bug", and definitely not a Tahr issue.
http://murga-linux.com/puppy/viewtopic.php?t=98133
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#32 Post by Marv »

I'm back in LxPupSc 17.08.1 which has librsvg 2.40.18, pretty much represents the current woof-ce, and has the failed embedding. Checked all of the dependencies listed on the librsvg site for that version and they are present, woof-installed, and the version numbers are exactly what is called for. Quickly tried a direct sub. of the older libraries and not unsurprisingly that wouldn't display any of the system icons. Alas, no progress, just a bit of additional data.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#33 Post by perdido »

Just an update about librsvg libs substitutions in 32 & 64 bit Xenialpup.

In 32-bit Xenialpup 7.0.8.1 substituting the librsvg libs from 32-bit precise fixes the Locator window map display in 32-bitXenialpup with no ill system effects so far.

In 64-bit Xenialpup 7.0.8.4 substituting the librsvg libs from 64-bit ubuntu precise does not fix the Locator window map display in 64-bit Xenialpup.

.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#34 Post by perdido »

Udate about librsvg substitution in ttuuxxx 32-bit debian stretch-7.0.0a1

Works fine with no ill affects so far.

hamoudoudou

discovered in Green Puppy XFCE Chloe This Morning.

#35 Post by hamoudoudou »

discovered in Green Puppy XFCE Chloe This Morning. Good Idea to include it In your builds.
By Moat, April 2017 "Tahr is just my fat, amateur-ish, heavily re-mastered X-Tahr 2.0, by the Master Xfce Pup guru, rg66 - "
Does it really need translation ? Words are French words, Latin words
map = carte
save = sauver (Jpg 6x less than PNG)
Attachments
capture11008.jpg
Does it really need translation ?
(99.32 KiB) Downloaded 714 times

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#36 Post by Marv »

Here is a modified Locator 3.7 I use now. The embedded map displays in newer pups with it. It is Geoffreys 3.7 with perdidos library substitution (THANKS!) incorporated using LD_PRELOAD so the older libraries are used only by Locator (see lines 10 through 12 in the script). LD_PRELOAD will accept entries as a (: or space) delimited list but separate entries are easier to read IMO. At this point I have used this in enough different 'modern' pups over enough time with no problems so I'll post it. 32 bit pups only at this time. The icon etc can obviously be changed to suit. It is just the one I use cross-pup at the moment.
Attachments
locator-3.7.1.pet
Patched for embedding in newer 32b pups.
(106.21 KiB) Downloaded 358 times
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#37 Post by perdido »

Marv wrote:Here is a modified Locator 3.7 I use now. The embedded map displays in newer pups with it. It is Geoffreys 3.7 with perdidos library substitution (THANKS!) incorporated using LD_PRELOAD so the older libraries are used only by Locator (see lines 10 through 12 in the script). LD_PRELOAD will accept entries as a (: or space) delimited list but separate entries are easier to read IMO. At this point I have used this in enough different 'modern' pups over enough time with no problems so I'll post it. 32 bit pups only at this time. The icon etc can obviously be changed to suit. It is just the one I use cross-pup at the moment.
Hi Marv!
Outstanding!!!
This is working fine in UPUP Bionic Beaver :)

Thanks a lot for fixing this for the later pups!!!

.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#38 Post by BarryK »

Hi guys,
Locator is nice, but I hit that same problem with librsvg.

As far as I can make out, librsvg no longer supports xlink:href="file://". Instead, you have to embed the image, in base64, and use xlink:href="data:".

base64 utility is a busybox applet, and should be in most/all pups and dogs.

I edited version 3.5, as that is the latest in the first page. /usr/bin/locator, line 274:

Code: Select all

#20180911 librsvg no longer supports xlink:href="file:, need to embed image...
base64 /tmp/locator/.png > /tmp/locator/base64.txt
echo "<svg width=\"640\" height=\"${IMAGE_HEIGHT}\">
   <image width=\"640\" height=\"480\" xlink:href=\"data:image/png;base64," > /tmp/locator/map.svg
cat /tmp/locator/base64.txt >> /tmp/locator/map.svg
echo '" />' >> /tmp/locator/map.svg

echo   '<text x="50%" y="'$TXT_LINE1'%"
	  style="text-anchor: middle; fill: '$FILL'; stroke: none; font-weight: bold; font-family: serif; font-size: '$FONT_SIZE'px;">
      '$ADDRESS'    
</text>
<text x="50%" y="'$TXT_LINE2'%"
	  style="text-anchor: middle; fill: '$FILL'; stroke: none; font-weight: bold; font-family: serif; font-size: '$FONT_SIZE'px;">
      '$ADDRESS2'    
</text>
<text x="50%" y="'$TXT_LINE3'%"
      style="text-anchor: middle; fill: '$FILL'; stroke: none; font-weight: bold; font-family: serif; font-size: 18px;">
     Latitude: '$LATITUDE' Longitude: '$LONGITUDE'
</text>     
</svg> ' >> /tmp/locator/map.svg
Works!
Well, the above could be improved, can remove that intermediate "base64.txt".

Script attached, remove the .gz, set executable:
Attachments
locator.gz
false .gz, just rename to 'locator'
(38.77 KiB) Downloaded 235 times
[url]https://bkhome.org/news/[/url]

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#39 Post by Marv »

Thanks!
Tested in upupcc-18.09alpha1 and lxpupsc64-18.06 +6 for now as those are what I'm running most. Also applied BarryKs patch to Geoffreys 3.70 and tested it in the above pups. It is working well in both.
Last edited by Marv on Tue 11 Sep 2018, 22:25, edited 1 time in total.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

roadkill13
Posts: 154
Joined: Wed 10 Aug 2011, 21:41
Location: United States
Contact:

#40 Post by roadkill13 »

@Marv wrote:
Tested in upupcc-18.09alpha1 and lxpupsc64-18.06 +6 for now as those are what I'm running most. Also applied the patch to Geoffreys 3.70 and tested it in the above pups. It is working well in both.
I successfully tested the patch with Marv's version 3.7.1 in Quirky Xerus 8.6 as well. Thank you for that version Marv. Geoffrey had a great idea!

@BarryK

Thank you for the patch.

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#41 Post by Marv »

I edited my post 2 posts above to clarify that I now have tested BarryKs patch in the 3.70 version. My original approach adding in the older libraries worked reliably in a wide variety of pups but did not work in 64b puppies and involved carrying the older libraries. BarryK did it right. Less overhead and works in both 64b and 32b pups.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#42 Post by BarryK »

I created a PET in the repo for EasyOS and Quirky, gave it version number 3.7.2:

http://bkhome.org/news/201809/locator-m ... iewer.html

It should work in all pups.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#43 Post by BarryK »

I am finding using Locator is hit-and-miss, mostly miss. When addresses are entered, failure is reported. Actually, the text returned in /tmp/locator/LOCATION is:

Code: Select all

{
   "error_message" : "Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account",
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}
It is making Locator pretty much unusable. Supposed to get an api key:

https://cloud.google.com/maps-platform/ ... t-changes/
[url]https://bkhome.org/news/[/url]

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

gooooogle monkeywrench alert

#44 Post by Marv »

All patched flavors of locator were working well and displaying maps on all pups for me as of September 11 2018 here. Alas, they no longer do for me. The reason is that google is now is enforcing the requirement for an API developer key for static maps so the wget line to retrieve the static map fails with a 403 error. Could someone confirm? The Lat and Long retrieval and clickthrough to google maps still work here. Grrr. BarryK confirmed while I was typing...
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Re: gooooogle monkeywrench alert

#45 Post by Geoffrey »

Marv wrote: Grrr. BarryK confirmed while I was typing...
That's a shame guy's, when I first started this I did so as I found it didn't need a api key, then a key was only required the retrieve more detailed information.

Image retrieval appears to still work

https://maps.google.com/maps/api/static ... =satellite

That would be right now it won't let the map view, they must be watching me it worked fine earlier today.
Last edited by Geoffrey on Wed 19 Sep 2018, 08:35, edited 1 time in total.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#46 Post by Geoffrey »

OK, I been looking around, OpenStreetMap may be the fix to get coordinates from, info here https://wiki.openstreetmap.org/wiki/Nominatim

I don't have a working linux machine with puppy at the moment, if someone with the inclination to fix this and would like to, I'm sure others would appreciate it.

This code should work to get the required info.

The Google map download still works, the only thing that appears to be the problem was retrieving location data to acquire the map.

Where there's a will there's a way

Code: Select all

wget -O /tmp/locator/LOCATION 'https://nominatim.openstreetmap.org/?format=json&addressdetails-1&q='$location'&format=json&limit=1'
Edit: it looks like they have now activated the requirement for a api key to access the maps too, worked fine this morning, OpenStreetMap may be the only hope.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#47 Post by Geoffrey »

I declare Locator officially dead, googles grab for cash and world domination is to blame. :lol:
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
spiritwild
Posts: 181
Joined: Mon 03 Oct 2016, 10:06

#48 Post by spiritwild »

is this of any similarity to google maps? https://developer.here.com/documentation

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#49 Post by Geoffrey »

spiritwild wrote:is this of any similarity to google maps? https://developer.here.com/documentation
Yes it's similar, but just as Google has done it cost money for a key.

I looked at Openstreetmap tile servers but they are pretty basic with no detail.

https://wiki.openstreetmap.org/wiki/Tile_servers

Image

A search for location json file is easy to get from openstreetmap, the problem is displaying a map.

I couldn't find a way of extracting the map from the webpage, the "#map=16" is the zoom level, there is no satellite view.

https://www.openstreetmap.org/#map=16/-24.8894/152.3197
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#50 Post by BarryK »

I stumbled across Overpass API, only looked at it very briefly, might be useful:

https://wiki.openstreetmap.org/wiki/Overpass_API
[url]https://bkhome.org/news/[/url]

Post Reply