Map Service

Discussion in 'General Discussion' started by Fenyx4, Jun 30, 2014.

Thread Status:
Not open for further replies.
  1. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8
    I'm working on a tile map service for SotA. It is designed to work with Google Maps API, Leaflet and other libraries.

    The API is straightforwards;

    Code:
    http://fenyx4.com/sota/map/{continentid}/{z}/{x}/{y}.png
    
    and
    
    http://fenyx4.com/sota/map/{continentid}/scenes/{sceneid}/{z}/{x}/{y}.png
    
    continentid :
        1 = Novia*
        2 = Hidden Vale*
    sceneid (For Novia):
        1 = Ardoris*
        2 = Solace Bridge*
        3 = Vertas Pass*
        4 = The Veiled Swamp*
        5 = Graff_Gem_Mines*
        6 = PaxLair_Metro
        7 = Soltown
        8 = Grunvald Shardfall
      
    sceneid (For Hidden Vale):
        1 = Owl's Head*
        2 = Valemark
        3 = Braemar*
        4 = Kingsport*
        5 = Ravensmoor*
        6 = North Ravenswood*
        7 = South Ravenswood*
        8 = Mysterious Swamp*
        9 = Northmarsh*
        10 = Southmarsh*
        11 = Obsidian Keep*
        12 = Deep Ravenswood*
        13 = Wynton's Folly
        14 = Kingsroad*
        15 = North Valeway*
        16 = South Valeway*
        17 = Wyrmsands
        18 = West Ravenswood*
    
    *Have coordinates in sotamap-0.03.js (sotamap-0.03.min.js)
    
    You can very easily add the map to any website. Here is an example with Leaflet.

    HTML:
    <html>
    <head>
        <link rel="stylesheet"
              href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
    </head>
    <body>
        <div id="map" style="width: 700px; height: 500px"></div>
    
        <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
    
        <script>
            var map = L.map('map', {
                crs: L.CRS.Simple,
                zoom: 6,
                minZoom: 1,
                maxZoom: 7,
                continuousWorld: true,
                noWrap: true,
                tms: true
            }).setView([150, 150], 1);
    
            map.attributionControl.addAttribution("<a href=\"https://www.shroudoftheavatar.com/\">SotA</a>");
            map.attributionControl.addAttribution("<a href=\"http://www.fenyx4.com/\">Fenyx4</a>");
    
            L.tileLayer('http://fenyx4.com/sota/map/2/{z}/{x}/{y}.png', {
                zoom: 6,
                minZoom: 1,
                maxZoom: 7,
                continuousWorld: true,
                noWrap: true,
                tms: true
            }).addTo(map);
    
        </script>
    </body>
    </html>
    I've also written a small javascript library to help map the in game coordinates to the tile coordinates. You can find that here. (I've only used it in Leaflet. No guarantees it will work for other mapping libraries.)

    Here are is an examples of it in use;

    Marking locations in the Hidden Vale.

    And finally here is an example of a scene (Owl's Head) on a map of its own without the rest of the continent.

    All of this, much like the game, is in Pre-Alpha. The API isn't set in stone. (Don't lawyer me bro.)

    I've already begun integrating it into sotawiki.net as seen here but I'm really curious how others will use it.

    I'd really like to get more scenes into it (or ALL scenes) but I doubt the devs have time to make a nice map for every scene. I'm no artist but I've starting putting together the specifications I'd need for the maps and a graphics pack for people to use. I'll post it here once it is ready. Then people could give me their maps and I could merge it all into the service. I'd love to have a group of cartographer's out surveying New Britannia!

    Let me know what you think!

    EDIT: More scenes added. Still need to add coordinate calculations to the javascript.
    More EDIT: More coordinates more scenes.
    Moar EDIT: More scenes
     
    Last edited: Oct 8, 2015
    One Zero, maathyas, Grimace2 and 20 others like this.
  2. Violation Clauth

    Violation Clauth Avatar

    Messages:
    3,247
    Likes Received:
    7,594
    Trophy Points:
    165
    Gender:
    Male
    This is the map I was talking to you about @Winfield @DavenRock @Amberraine @MulGirtab and others. Please help @Fenyx4 populate this with whatever data you have. Cheers!
     
    DavenRock [MGT] likes this.
  3. Max Bennis

    Max Bennis Avatar

    Messages:
    303
    Likes Received:
    536
    Trophy Points:
    55
    Gender:
    Male
    Location:
    Seoul, South Korea
    This is going to be purely AWESOME. Keep on your good work!
     
    DavenRock [MGT] likes this.
  4. Mata

    Mata Avatar

    Messages:
    4,027
    Likes Received:
    9,894
    Trophy Points:
    153
    Gender:
    Female
    Location:
    Ruhrpott - Deutschland
    Fantastic!
    Good Work!
     
    DavenRock [MGT] likes this.
  5. Trenyc

    Trenyc Avatar

    Messages:
    1,503
    Likes Received:
    2,966
    Trophy Points:
    125
    Gender:
    Male
    Wow, this will be so cool. It'll be great to have a map of important locations kept on the Wiki, and I can see this being especially valuable to sites like the SotA Travel Guide. Thanks again, Fenyx. :)
     
    DavenRock [MGT] likes this.
  6. Biblik

    Biblik Avatar

    Messages:
    353
    Likes Received:
    542
    Trophy Points:
    55
    Location:
    Soltown
    Looks pretty cool. Are those the only two end points that are available for the API? Do you have a list of any others?

    Also on the SotaWiki clicking on map regions or landmarks doesn't appear to zoom in - should there be another parameter for zoom level or something?
     
  7. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8


    Currently those are the only endpoints. I am planning on adding one for meta information (i.e. what continents and scenes are available and their names/ids). Any other ideas?

    The {z} in the URL is the zoom level. For the Leaflet library (which is what I use on the wiki and for the examples) you can change the zoom level with the setView method.
     
    DavenRock [MGT] likes this.
  8. Biblik

    Biblik Avatar

    Messages:
    353
    Likes Received:
    542
    Trophy Points:
    55
    Location:
    Soltown

    I could see benefit in being able to add landmarks to the map using one of the mentioned libraries to get the coordinates and then calling the API but of course that could get out of hand quick so you would have to have some sort of granularity in either authorizing or separating maps which could get difficult.

    Gotcha on the Z, not sure why I didn't think of that : ) Of course there isn't a 3rd dimension on a 2d map.
     
    Lord Trenyc likes this.
  9. TheMadHermit

    TheMadHermit Avatar

    Messages:
    645
    Likes Received:
    3,359
    Trophy Points:
    93
    Well done @Fenyx4. Love it!
     
    FanofIolo and DavenRock [MGT] like this.
  10. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8
    The wiki itself has a querying API. I'm still trying to sort out exactly how we should be entering and storing the coordinates but, for example, the Hidden Vale map on the wiki is pulling the marker locations from this query.

    The wiki API is complicated but there is a page to help craft queries which can be found here.
    And here are some more links explaining it;
    http://semantic-mediawiki.org/wiki/Help:Special:Ask
    http://semantic-mediawiki.org/wiki/Help:Result_formats

    I'll gladly help craft queries for people as I love to see the data being gathered by the community on SotAwiki being reused by community. (We've got a couple sites already pulling from us.)

    If people do pull data from the wiki for their own uses we'd appreciate being attributed. "Powered by SotAwiki.net" or some such.
     
    Lord Trenyc likes this.
  11. Biblik

    Biblik Avatar

    Messages:
    353
    Likes Received:
    542
    Trophy Points:
    55
    Location:
    Soltown

    I don't quite follow - the API you mentioned above is for the locations on a map. If you wanted to add a new location through the API is that possible? And if so / if not why would you use the Wiki's API instead of the map services API directly?
     
  12. Joviex

    Joviex Avatar

    Messages:
    1,506
    Likes Received:
    3,122
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Burbank, CA
    its great, but I wish someone would have mentioned it earlier.

    I know you guys knew I had been doing the same thing for over half a year. Along with the Google api, there was also a collection service of POIs.

    Both links in my sig, and, you know I have mentioned it more than once in the irc.

    I had even asked to use the wiki as hard link point s, which you guys approved. o_O
    cheers.
     
    Bubonic likes this.
  13. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8
    Are you referring to the Wiki API here? If so then you will be able to add a new location by creating a page on the wiki and putting in the correct infobox template with the coordinates.
    If you are referring to the Map Service API then I wasn't planning on providing landmark coordinate as that can be retrieved from the wiki.
    If you are referring to the Leaflet API then you can totally add any landmarks you want to add. All my Map Service is doing in this case is serving up the images for Leaflet to use.

    Hope that answers your question. I may be confused as to what you are asking though.
     
  14. Bubonic

    Bubonic Avatar

    Messages:
    2,455
    Likes Received:
    7,975
    Trophy Points:
    153
    Gender:
    Male

    i must admit that's a bit confusing
     
  15. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8
    Hey Joviex. Sorry I didn't mean to step on your toes. My understanding of your project was that it was an product unto itself and not a service meant to help others make products. And that your project was on hiatus as you waited for coordinates to be finalized by the developers. If I was in error about any of that I apologize.

    Mine came about because I wanted to embed maps on the wiki. To do so I needed a Tile Map Service. Upon making one I realized I could make it available to everyone.

    There wasn't much earlier to mention this either. I only got started on it last Thursday.

    You are of course still welcome to use data from the wiki.
     
  16. Mishri

    Mishri Avatar

    Messages:
    3,812
    Likes Received:
    5,585
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Great Falls, MT
    Well Fenyx4, yours runs a heck of a lot faster than Joviex's. It takes way too long to load his map. I've done some map creation for android, used osmdroid. I sold that software, can't share it. It had a lot of functionality added to it that you wouldn't really need anyway.
     
  17. Joviex

    Joviex Avatar

    Messages:
    1,506
    Likes Received:
    3,122
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Burbank, CA
    No worries, was just mildly confused =p

    To some extent yes, we stopped for a bit because unfortunately we have not seen the mainland, and were holding off a bit in lieu of the actual lat/long lines being in agreement especially as the vale map is off to the NE of the mainland and the original lat/long lines don't match.

    The hope was that a real geo coords could be ultimately used, but I am leaning towards it was not planned, and will not be back engineered to do so.

    The other part was I am hoping that the coordinates get absorbed into the wiki, but the collection points are extremely discrete, like per vendor stall, chest(s) locations, etc... Not sure you guys will/would ? put them up there in some fashion


    Cheers.
     
  18. Joviex

    Joviex Avatar

    Messages:
    1,506
    Likes Received:
    3,122
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Burbank, CA

    Wow, backhand much?

    It is on a development box running all manner of services, and is not meant as a first class release. As is pretty much every post I have made on the subject.

    But go ahead, attack like you want.

    Cheers.
     
    DavenRock [MGT] likes this.
  19. UnseenDragon

    UnseenDragon Avatar

    Messages:
    404
    Likes Received:
    1,097
    Trophy Points:
    55
    Gender:
    Male
    Location:
    Columiba, MD
    Looks awesome!
     
    DavenRock [MGT] likes this.
  20. Fenyx4

    Fenyx4 Legend of the Hearth

    Messages:
    84
    Likes Received:
    179
    Trophy Points:
    8
    I'm hoping the coordinates in the Tile Map Service won't have to change and if they change their coordinates I'd just have to update http://fenyx4.com/sota/map/sotamap-0.02.min.js . We'll just have to wait and see how well that works in practice. :)



    I really want to get the wiki down to that level of detail. Need to got more people contributing to it!
     
Thread Status:
Not open for further replies.