Menu
Baran Kahyaoglu Dev Blog
Baran Kahyaoglu Dev Blog

MapzenGo Part 7 : Plugins

Posted on 13/09/2016 by brnkhy

Well yes, I decided to change the name of the series to simply “MapzenGo”. It’s shorter and admittedly, “PokemonGo clone” was a bit of a click bait. But hey, advertisement eh??
Anyway, we have another big update here. Mainly infrastructure stuff but I think you’ll all find them useful.

mapzen pokemongo openstreetmap layers offline maps buildings tokyoGood old Manhattan

-Major thing here is the new plugin system. Well I changed the factories a bit…again but nothing big really. First of all, I introduced a new base class called “Plugin”. It has a simple “Create” function and will be used for both factories and additional… plugins. So plugins are classes which operates on Tiles. Simple as that. Factories take tiles and creates buildings, roads etc. Other plugins, takes tiles and puts map images on them, add custom objects, maybe create forests or something.

So now you can create a class, inherit it from plugin, fill up the create method and put it under the World object in the scene. It’ll work right away.
That being said, I’m not done with refactoring the factories yet, I’ll remove the create from base factory class and leave that part to sub classes as well. That won’t effect the plugin system though, you’ll be able to work on your own plugins unaffected.

-Then I implement as very simple CustomObjectPlugin. People has been asking about how to visualized their own custom locations for weeks now. And yes it wasn’t really straight forward how to convert lat/long to unity3d position but this new plugin should help you with that. It’s just a sample really, nothing fancy going on there and you’ll probably need something much more complex for your needs but this should be enough to get you started.

-Then there is a great editor script, written by Roman (thanks mate!), to search places and use their lat/long right away. Admittedly I haven’t checked the code in detail but it uses Mapzen search api to find places, retrieve their lat/long and pass it to the tile manager. It’s so much easier now to navigate between different places, be it Manhatta, Paris or Istanbul.

mapzen pokemongo openstreetmap layers offline maps buildings tokyo search mapzengoSo much easier to test different place now.

-And I also fixed namespaces to match file locations. Should have done this much earlier, no idea how I missed it.

-Oh wait I actually forgot the biggest thing, entity settings and filtering! Well I did talked about this a little in previous posts but extended it a lot since then.
Ok, what is it? Remember, we didn’t have much chance to customize stuff before; hust some hard coded materials which wasn’t enough for anything really. No chance to set road widths, materials by building type etc.
So we have a new settings system to fix that! If you check the factory objects in the scene, you’ll see that there is a new Settings list under it. Using that list, you can customize, let’s say highway roads width or religious buildings material.

Even better, some factories (not all) are using those settings to filter entities, i.e. Road factory won’t render “ferry” routes if you don’t have a settings for that! This saves us from all the mess in big cities and helps us get a cleaner look. If I recall correctly, only building factory doesn’t use this filtering method. Building factory will render every single building and use custom settings on selected typed buildings.
We have only a few customization properties for now but it’s quite easy to add anything whenever we need. Ah and Roman is also working on moving all those settings to ScriptableObjects, it’ll get much easier to use as well.

mapzen pokemongo openstreetmap layers offline maps buildings stockholmStockholm

And that’s all for now I guess. I’ll try to look into gps, UV maps and other stuff next few weeks, no promises though, day job is getting quite intense these days.

Let me know what you think! You can mail me, post here or create issues on MapzenGo Github page. I also added a donation button at the right column (and at the bottom of this post), consider that as buying me a coffee or a beer. Oh I can definitely use a weihenstephaner right now…

Cheers,
Baran

MapzenGo Github Page
Twitter (started posting beauty shots and whatever there)
Download MapzenGo Part 7: Plugins

[paypal_donation_button align=”left”]

Save

Share on Social Media
twitter facebook linkedin reddit email

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

  • Mapzen
  • MapzenGo
  • OpenStreetMap
  • PokemonGo
  • Unity3D
  • 14 thoughts on “MapzenGo Part 7 : Plugins”

    1. Alexey says:
      13/09/2016 at 9:29 pm

      Thank you very much for those updates.
      You have done a very great job.

      Reply
      1. brnkhy says:
        13/09/2016 at 10:30 pm

        Thanks Alexey! Glad you like it 🙂

        Reply
    2. kano says:
      15/09/2016 at 12:09 pm

      hi brnkhy,im testing this new version.now the missing building appears….but i have a few questions.if i want to see the map plane,the only way is using the map image script without url?is the only way i found to do it.
      And the other question is about coordinate y on objects.the map is y=-1,the buldings and landfuse on y=0, but roads are on y= 3.6…..can that be changed?
      ah…and the search script is great….now is more easy to test places….thanks….

      Reply
    3. brnkhy says:
      15/09/2016 at 12:31 pm

      Hey,
      I’m afraid I don’t understand that first part 🙁 You want the base mesh (rectangle) without the map? You can simply comment out the texture calls in that plugin for that?
      Y axis usage is incomplete at the moment, we’re work on it here; https://github.com/brnkhy/MapzenGo/issues/29
      Feel free to change that as you like 😉
      And kudos to Roman for that search script, he submitted that!

      Reply
    4. kano says:
      15/09/2016 at 2:37 pm

      thanks brnkhy……thas it what i mean…..in other version you can activate or not the image map,but the base mesh still there,in this version, i only can do it changing code…..ok…;-)…..

      Reply
    5. Isa says:
      17/09/2016 at 5:42 am

      Thanks for this wonderful code, makes it so accessible. May I use this for a commercial project.

      Reply
    6. Isa says:
      17/09/2016 at 5:43 am

      I will buy you coffee lol 🙂

      Reply
      1. brnkhy says:
        17/09/2016 at 3:01 pm

        Coffee first!!! 🙂
        You can use it however you want man. It’s already MIT license. All you have to do it to include that license txt file somewhere and it would be great if you can give credit somewhere so I’ll be able to brag about it around 🙂
        Other than that, change it, use it whatever, I don’t really care 🙂 good luck

        Reply
    7. Paulo says:
      28/09/2016 at 1:31 am

      Hi brnkhy, Thank you so much for the work done here. I can’t wait for the GPS and path navigation. That’s really awesome…

      Reply
      1. brnkhy says:
        28/09/2016 at 10:36 am

        Glad you like it man!

        Reply
    8. Paul says:
      28/09/2016 at 4:16 pm

      Damn, this is an awesome bit of work! Loving it!

      Reply
      1. brnkhy says:
        28/09/2016 at 5:53 pm

        Thanks man, glad you like it!

        Reply
        1. Paul says:
          30/09/2016 at 2:08 pm

          It’s ace! Quick question, you’ve managed to get the roads to be mapped out with the factory. Would it be difficult to transfer that to the rail?

          Reply
          1. brnkhy says:
            30/09/2016 at 2:24 pm

            Well I havent looked into the rails but I believe some of them (metro?) are already present in road layer. There is also a layer called “transit” just for railroads as well, shouldn’t be any different than road layer so will most likely be travial to implement 😉
            https://mapzen.com/documentation/vector-tiles/layers/#transit

            Reply

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Search

    Subscribe to Blog via Email

    Follow me on Twitter!

    My Tweets

    Categories

    • Desktop Development (26)
    • Game Development (39)
    • Mapbox Unity SDK (4)
    • Uncategorized (8)
    • Unity3D (21)
    • Web Development (6)
    • WinRT Development (1)

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    ©2025 Baran Kahyaoglu Dev Blog | Powered by WordPress & Superb Themes