Kodi Community Forum

Full Version: Maps Add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Maps

Image
Map mode with controls

Current Version: 0.1.0
Last Update: 2014-08-15
This add-on is still under development. Some of the final features are not yet implemented.

By utilizing multiple maps and locations providers, this addon will allow you to explore the World map and find points of interest. The providers can be categorized as: Map Providers, Geocoding Providers, Places Providers, Panorama Providers, or any combination of the four. It currently has Google (Map/Geocoding/Panorama), Bing (Map/Geocoding), HERE (Map), MapQuest (Map), and Foursquare (Places). You can select any combination of map/geocoding/places providers to be used together. For example: you can select Google as the map and geocoding provider, but use Foursquare as the places provider (the default). Alternatively, you could select Bing as the map provider, Google as the geocoding and panorama provider, and Foursquare as the places provider.

More importantly, anyone can add a new provider, and the add-on will dynamically detect the provider and allow the user to use it without any need for updating the add-on itself. The providers are simple python classes having predefined set of methods, each placed in its own file inside the providers directory (/resources/provider). The provider classes can even specify the configuration required for them (such as API keys and secrets), and the add-on will update the add-on settings dialog dynamically to let the user specify them from there. The current provider class standard is not finalized, and it might change in the future if needed.

Please note that many providers requires you to have API keys to use their associated services. You can acquire your credentials from their developers websites for free, and then type them in the add-on settings dialog under "Credentials". There are paid plans for each service, but I don't think anyone will need one, especially with a Map software on an HTPC. Currently Google allows you to use their service without a key, but the usage limit will be based on IP (which is mostly shared), and will allow a limited number of requests. By using a key, the number of allowed requests will increase, and it will not be tied to your IP. Most other providers don't work without a valid API key (or a pair of keys).

Image
Panorama mode in London, United Kingdom

How to Install
  1. Download the add-on from below, and place it in a directory accessible by XBMC.
  2. In XBMC, go to System > Add-ons > Install from zip file, and browse through and select the downloaded add-on.
  3. Run it from the programs add-ons, and enjoy!
Important: to fully use the add-on, you need to get the API keys/secrets for each service you want to use from the service providers. Once you get them, you can type them in the add-ons settings dialog under "Credentials".

How to Use
You can use the remote, keyboard, gamepad (limited).
Pan: Up, Right, Down, Left buttons.
Zoom: Page Up, Page Down, Channel Up, Channel Down buttons.
Map Type Toggle: Info button.
Controls Toggle (Search/Home/Places): Context Menu button.
Heading (Panorama): Right, Left buttons
Pitch (Panorama): Up, Down buttons
Move (Panorama): Page Up, Page Down, Channel Up, Channel Down buttons (Not currently supported by Google Street View Image API).
Exit Controls/Panorama: Return/Exit buttons
Exit: Return/Exit buttons.
Note: the controls are still not finalised, and might be adjusted in the future. Suggestions are welcomed.

How to Create a New Provider
If you are interested, then you probably already know enough python. In this case, please review the add-on directory (script.maps/resources/provider) for a list of the current providers and how are they implemented. Each class must have a static method providerInfo, which will return the name and the required settings (id/label pairs). Also, based on the type of provider, you need to implement the minimum required methods.
Map Provider: you must implement the methods type, size, pan, zoom, and url.
Gecoding Provider: you must implement the method geocode.
Places Provider: you must implement the method places.
Panorama Provider: you must implement the methods look and move.
Mixed Provider: you must implement all the methods required by each type in the same class.
After creating a class that satisfy the above, save it to the same directory. Then, open the add-on to dynamically load it and update the add-on settings. After that, go to the add-on settings dialog and you will find your provider in the list, and its settings in the Credentials tab.
Note: keep in mind the provider class standard is still not finalised.

FAQs
Any frequently answered questions will be placed here.

Change Log
Version: 0.1.0 Date: 2014-08-15
Added support for a new type of providers: Panorama Provider.
Added panoramic view support to the Google provider (Google Street View).
Added a new "Panorama" mode to provide panoramic views in certain places. [suggested by schumi2004]

Version: 0.0.1 Date: 2014-08-14
Initial beta.

TL;DR
An add-on for maps with support for searching for locations (geocoding), POI (places), and panoramic views (street view). It can be extended by anyone interested without changing the add-on itself. Use common sense for controls, and context menu button to toggle the controls overlay.

Download
Current Version 0.1.0: bit.ly/VqDDVR

Old Version 0.0.1: bit.ly/XkUtr3

Suggestions and bug reports are welcomed
Mmmmm this looks fun.

Would be cool if you could do some street view kinda stuff Wink
Just implemented that, and bumped up the version Smile
I forgot to credit you in the change log, but I'll make sure to mention you in the next update.
(2014-08-15, 03:31)a.a.alsaleh Wrote: [ -> ]Just implemented that, and bumped up the version Smile
I forgot to credit you in the change log, but I'll make sure to mention you in the next update.

No need to give me credits just for suggesting something Wink
Update looks great btw.

Another suggestion, position indicator.

I just noticed this is your first post on XBMC/Kodi.
Welcome and thanks for this cool addon.
really really interesting, i will try this soon.
good job.
Peppe
Nice. I like it.

That said, on my Android TV Box, using my regular infared remote, I am unable to zoom in/out from the main world view. I can pan left, right, up, and down, but have no way of zooming in. I can zoom in/out on my laptop, as well as on my tv box using a wifi keyboard remote (that has PgUp/PgDn buttons, so I am guessing my remote just needs different button mapping to work.

Also, I am unable to move forward/back or zoom in/out while in street view on my tv box using either the regular remote or my wifi keyboard one. That would be cool if that could work. Of course I saw this was not currently a feature from your first posting.

Not a big deal but I also notice a little lag in main view whenever I move the whole thing left, right, up, and down. The screen shoots to black for a fraction of second before resuming with the world map image. Again, not a huge issue. It might just be a result of the platform I am using it on, although this is the same on both my Linux Laptop and OpenElec TV Box.

Finally, another feature that might be nice is if we can use the cursor, which is shown when on a map, and zoom in via left clicking. I tried on my laptop but it must not be a feature yet. As such, I am guessing I would be unable to do similar on my tv box either. Or even dragging via the cursor and left clicking. Basically, it would ultimately be great to be able to make the map move just like you can when actually going to Google Maps.
How about the ability to scrape "Shooting Location" info on IMDB and then open a map to the location?
I have had an issue since first testing this out a few days ago. Every now and then, upon opening the Maps addon I get no world map at all; only a black screen. That said, I still can press 'C' and have the top panel pop up allowing me to enter an address. I can even go to street view if I want. But not the regular map. I do not know what has changed. I have uninstalled and coped back over my entire '.xbmc' folder on my tv box and it works like before. But it does not work when uninstalling and reinstalling on my Linux machine. I a confused by this.

Anyway, just thought I'd mention it. Will test further.
@schumi2004
Thanks mate. I was planning to add marker support not only for current location but also for home and places. I also plan to add mini map for panorama mode. It is just that I am a bit busy at the moment.

@peppe_sr
Thanks. Glad you enjoyed it.

@nickr
The add-on is designed so that it can be extended easily with providers, exactly like Kodi/XBMC can be extended with different scrappers. Currently, I would categorise "Shooting Locations" as a Places Provider. Anyone interested can add a class with the method "places", that accepts a search query (here should be movie title for example) and scrap the information from IMDb, then it shows all the places. I don't have time for this now, but would consider doing it. Of course, I welcome anyone doing it if interested. I also plan to allow other add-ons to display a custom map with custom markers by calling the Map add-on with parameters, so it can be done by external add-ons.

@xbmcwayist
Thank you for your extended testing.
* For the zoom in/out in Map mode, I currently use a regular universal remote with Page Up/Down buttons. I thought many remotes won't have such buttons, and this is why I added Channel Up/Down buttons as well. It just turn out that some remotes don't have all these buttons. Thank you for mentioning this issue, but I would have preferred if you suggested an alternative buttons that I can add for you.
* For the zoom in/out in Panorama mode, I already mentioned that Google Street View Image API doesn't support going forward or backward. Yes, you can do that in Google Map, but you cannot do it through the API, yet. So this is not technically possible. Once it is allowed through the API, it will be a simple change.
* I am aware about the lag issue, but I cannot do anything about it. It is related to the speed of your Internet connection, the speed of the Map Provider (e.g. Google is faster than Bing), the quality of the map you choose, and the processing power of your device. Keep in mind, this is static image service, and not javascript one that can lazy load or do progressive load. One way to improve the delay, is to enable Caching from the add-on settings dialog. Be aware that this can consume the HDD space quickly, so be sure to set it to automatically clear cache on exit. I've seen the black screen many times, it is due to the same issue, and can be improved with caching. I'll see if I can improve it.
* I am not planning to support mouse, Kodi/XBMC is intended to be used using a remote. If you are going to use a mouse, then you are probably better of using Google Map or Bing Map instead.
* For your final issue, there are many probable causes. Did you enter the API keys for the providers you are using? Maybe you exceeded the usage limit of the Map Provider you are using? Or maybe you have enabled manual caching, and your cache is filled with black screen due to one of the previous two problems? Try adding API keys, and make sure you clear the cache (and set it to clear on exit), or even disable cache altogether.
(2014-08-28, 21:43)a.a.alsaleh Wrote: [ -> ]@xbmcwayist
Thank you for your extended testing.
* For the zoom in/out in Map mode, I currently use a regular universal remote with Page Up/Down buttons. I thought many remotes won't have such buttons, and this is why I added Channel Up/Down buttons as well. It just turn out that some remotes don't have all these buttons. Thank you for mentioning this issue, but I would have preferred if you suggested an alternative buttons that I can add for you.
* For the zoom in/out in Panorama mode, I already mentioned that Google Street View Image API doesn't support going forward or backward. Yes, you can do that in Google Map, but you cannot do it through the API, yet. So this is not technically possible. Once it is allowed through the API, it will be a simple change.
* I am aware about the lag issue, but I cannot do anything about it. It is related to the speed of your Internet connection, the speed of the Map Provider (e.g. Google is faster than Bing), the quality of the map you choose, and the processing power of your device. Keep in mind, this is static image service, and not javascript one that can lazy load or do progressive load. One way to improve the delay, is to enable Caching from the add-on settings dialog. Be aware that this can consume the HDD space quickly, so be sure to set it to automatically clear cache on exit. I've seen the black screen many times, it is due to the same issue, and can be improved with caching. I'll see if I can improve it.
* I am not planning to support mouse, Kodi/XBMC is intended to be used using a remote. If you are going to use a mouse, then you are probably better of using Google Map or Bing Map instead.
* For your final issue, there are many probable causes. Did you enter the API keys for the providers you are using? Maybe you exceeded the usage limit of the Map Provider you are using? Or maybe you have enabled manual caching, and your cache is filled with black screen due to one of the previous two problems? Try adding API keys, and make sure you clear the cache (and set it to clear on exit), or even disable cache altogether.

Yeah, neither my Harmony Universal or the original/regular remote for my Android TV Box have Page Up/Down buttons. As you said you added Channel Up/Down buttons, you mean to say that those should work on regular remotes too as a means to zoom in/out? If so, unfortunately, that is not the case for me. As for some alternative buttons, I guess in case neither the Page Up/Down ones or the Channel Up/Down ones work, the fast forward and rewind could be another option.

Indeed. I read that on your posting about the zooming in/out in Panorama Mode. I was not aware the API differed from the actual Google Map. I think I misread that bit. Sorry about that. Anyway, it is a shame it cannot yet. That would make it really cool.

Hey, no worries. A little lag isn't a big deal. I can see it being a result of a number of different factors, as you said. I will also try that 'Caching' setting just to see if I do notice a difference. Thanks.

In regards to the decision to not supporting a mouse, I understand. Although, I actually was talking about a lot of the gyro remotes that provide the option of using a cursor to navigate and select on the big screen. I can see having support for a mouse/cursor would be good for those. Of course, if on an actual computer, why not just go to the actual Google Maps and/or Bing Maps.

Finally, I will look into adding API keys. I created one after first stumbling across your addon, but since I don't plan to use it extensively, I figured there is no reason to use an API. Of course, I don't really know a whole lot about them. As such, might a reason for the black screen then be due to exceeded the usage limit on a no API key run of the program? In all, I will be sure to try those suggestions you provided. Thanks again!
This is very attractive, but I need some help please.

I have Google, Foursquare, Bing and MapQuest credentials inputted. Google API has to be specific, i.e, whether a Server Key, a Web Key, Android, or IOS. Since I am running Jarvis-16 on Windows 10 I thought Google's Web API key would be the one needed for setting up the Maps Addon.

I, then, click on the "run" button on the Addon's Info Panel, I had a black screen. What is the proper way to use this Addon, please? This is the first time that these credentials are used, so there should be no question on limitations.

Thanks

steve

PS, On the General Tab, I can see Google was defaulted as Map Provider, Geocoding Provider, and Panorama Provider, and Foursquare was the Places Provider.
Wow this is an amazing addon Big Grin

Google maps working great, only issue is in street view the controls for zooming and moving arent enabled in this addon as it hasnt been updated for awhile.

The author hasnt logged on in few years, be great if someone could continue working on this addon.

Thanks
(2016-05-28, 16:09)the_bo Wrote: [ -> ]Wow this is an amazing addon Big Grin

Google maps working great, only issue is in street view the controls for zooming and moving arent enabled in this addon as it hasnt been updated for awhile.

Congratulation mate, would you mind teaching me how to launch this Addon as I got black screen in Windows 10?

I mean have you entered any API credentials? Was it only the Google API you have input or you have add others such as Foursquare? If Google Public API Key is used which type of key? Server? Web?

Thank you in advance!

Steve
(2016-05-29, 08:12)wstephen Wrote: [ -> ]
(2016-05-28, 16:09)the_bo Wrote: [ -> ]Wow this is an amazing addon Big Grin

Google maps working great, only issue is in street view the controls for zooming and moving arent enabled in this addon as it hasnt been updated for awhile.

Congratulation mate, would you mind teaching me how to launch this Addon as I got black screen in Windows 10?

I mean have you entered any API credentials? Was it only the Google API you have input or you have add others such as Foursquare? If Google Public API Key is used which type of key? Server? Web?

Thank you in advance!

Steve

Hi Steve I just ran it on default settings.

Google is default for maps geolocation and panorama. I think your allowed 25000 map refreshes each day on Google maps without an API key.

I didn't enter any keys or anything. I using raspberry pi 3 not sure if windows is different.

Have you another system to test it on?

Only downside on free goggle maps API is resolution for street view images is maxed at 640x640 so not best quality but least works.

Hopefully this add-on will get updated.
Thank you so much, the_bo

Yes, as soon as I have removed all the API keys I see the base map right away. And yeah, it's a great Add-on. Work real good in Windows 10, because there is a "Content" key on my Keyboard. A press on the Content key shows "Home" (My place in lat and long), then there are "Place" and "Panorama" too. My feel is it was targeted for operating with a TV Box Remote. On a PC, I have to use Left/Right keys for navigation, PgUp and PgDn to zoom in and out.

You say the Street View a bit low in resolution but it is OK to me. The strange thing is when I use the Place to search for a location it says I have used the service to its maximum limit (in fact it was only my first try). I input the Google API Key again just to see if it was because of having no key that triggered the "Maximum Limit". I had a black screen again. Removing it, the Addon resumes service.

I am of the view that this Addon should be given a fair chance to be further developed too. I had myPicsDB setup for photos. I did a translation on the string.po file, and I noticed xyCL (myPicsDB's Developer) has included a function in his view to use the geodata of the photos to bring up their relevant google map and street view. A great mission as I see it. What an excellent match between myPicsDB and Maps, we can't afford to miss.

Thanks again for you help. Very much appreciated.

Good day, mate!
Pages: 1 2