[INFO/WEB] Landmarks v0.2 - with DynMap addon [953]

Discussion in 'Inactive/Unsupported Plugins' started by DFYX, Apr 7, 2011.

  1. Offline

    DFYX

    Landmarks
    Version: v0.2
    Tested with Craftbukkit 953/Dynmap 0.19.1

    [​IMG]

    This plugin lets you define landmarks that will be saved into a JSON file, similar to the old MapMarkers for hMod. I have included a DynMap component that shows those landmarks as little icons on the map.

    [​IMG]
    If you like this, why not donate a few bucks? But don't worry, this plugin will always be free.​

    Features:
    • Set and delete landmarks
    • Display them on a DynMap
    • Full support for multiple worlds
    Download Landmarks 0.2 (Jar only, dynmap component only)
    Source Code
    Older versions: 0.1.1, 0.1

    Commands
    /landmark add <name>
    Set a new landmark to your current position. Name may contain spaces.
    /landmark modify <name>
    Set update an existing landmark to your current position. Name may contain spaces.
    /landmark set <name>
    Shortcut for add or modify depending if there already is a landmark with this name. Name may contain spaces.
    /landmark delete|del|remove <name>
    Remove an existing landmark. Name may contain spaces.

    Permissions
    (All permissions include the rights to use the matching aliases and shortcuts such as /landmark set)
    landmarks.add
    The player may use /landmark add
    landmarks.modify.own
    The player may use /landmark modify on his own markers
    landmarks.modify.all
    The player may use /landmark modify on all markers
    landmarks.remove.own
    The player may use /landmark remove on his own markers
    landmarks.remove.all
    The player may use /landmark remove on all markers

    Planned:
    • List existing landmarks
    • Show information like creator and time (already included in JSON file)
    • Think about priorities or grouping
    • Different icons? Probably larger icons for higher zoom levels.
    • Save display settings in cookies
    Setup:
    1. Just unpack the contents of the zip file into your bukkit folder.
    2. If you want to use the DynMap component:
      1. Go to plugins/Landmarks/config.yml and set markersfile to ../dynmap/web/markers.json
      2. If you have copied your dynmap/web folder to your Apache folder (as described in DynMap's setup instructions), use that path instead or use a symlink
      3. Go to plugins/dynmap/configuration.txt, find "components:" and add the following below it:
        Code:
          - class: org.dynmap.ClientComponent
            type: landmarks
      4. Optional: to display the settings panel, add the following just above what you added in the last step:
        Code:
          - class: org.dynmap.ClientComponent
            type: settings
    There's also a more detailed howto for Linux users below. Thanks, paccer!

    Changelog
    Version 0.2
    • Permissions support
    • New settings panel where people can select if they want to see the markers and marker texts (optional). See setup instructions step 2.4
    • Markers are now automatically removed from dynmap without reloading the page
    • New commands add and modify (they do basically the same as set, but you won't accidentally update an existing marker when you want to add a new one or the other way round)
    • The default config now contains the correct markersfile path for dynmap
    Version 0.1.1
    • Included config.yml and removed markers.json (will be created automatically)
    • Added a 2 pixel semi-transparent white border around the landmark icons
    • No changes to the jar file itself!
     
  2. Offline

    DFYX

    Strange. Your configuration.txt looks ok and landmarks.js is there, but Firebug tells me that it hasn't been loaded. No idea right now.

    Btw: there will be another few days of delay, probably until a 1.5_x compatible bukkit is there.
     
  3. Offline

    Tealk

  4. Offline

    DFYX

    Talked to Tealk on ICQ. Problem fixed itself.
     
  5. Offline

    Tealk

    Yea thanks for the fast help
     
  6. Offline

    Niklas

    Can you add PigMap support?
     
  7. Offline

    pedrofrq

    Using build 714.
    Works well, it loads the landmarks and all, but they don't show on web.

    Landmarks config:
    Code:
    markersfile: D:\CraftBukkit\CraftBukkit\plugins\dynmap\web\markers.json
    DynMap configuration.txt:
    http://pastebin.com/32EEj48w

    When I start the server no error appears:
    http://pastebin.com/bVUHzzvb

    5.109.18.181:8123
     
  8. Offline

    DFYX

    As described earlier, use double backslashes or forward slashes in Windows paths.
     
  9. Offline

    Matalok

    Works great with Pigmap as well. You can set your .json file output to be a web accessible location and modify your pigmap template with this snippet. replace the initMarkers function with:

    Code:
    function initMarkers() {
        if (markersInit) { return; }
    
        markersInit = true;
        $.getJSON("/markers.json",
            function(data){
                for (i in data) {
                    var item = data[i];
    
                    var converted = fromWorldToLatLng(item.x, item.y, item.z);
                    var marker = new google.maps.Marker({
                        position: converted,
                        map: map,
                        title: item.name + " - " + item.owner,
                        });
              }
          });
    
      }
    Also, insert a script inclusion for JQuery somewhere near the top.
    HTML:
    <script src="http://code.jquery.com/jquery-latest.js"></script>
     
  10. Offline

    Ratchet

    how do I set up permissions so that only people with permission can create landmarks? what are the permissions o_o
     
  11. Offline

    dwi

    Any chance how to include those nice tooltips and custom icons for landmarks?
     
  12. Offline

    Matalok

    For users i've got

    Code:
            - landmarks.add
            - landmarks.modify.own
            - landmarks.remove.own
    
    and for admins/mods

    Code:
            - landmarks.add
            - landmarks.modify.all
            - landmarks.remove.all
    

    Not yet, but its on my TODO list.
     
  13. Offline

    Niklas

    I did something wrong. Can you post your template with landmarks in it?

    Nvm, i fixed. BUT I ANT GOT NO SEXY ICONS :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  14. Offline

    dwi

    Niklas: Look above, Matalok said it is in his TODO list, hurray!

    btw does anybody know, why default landmarks tooltips are not visible (cursor is "drag hand" all the time) in some cases? I added some of them on our map (http://s.majncraft.cz/mc/pigmap/) and there is this hand cursor all the time
     
  15. Offline

    Matalok

    For the icon, copy the landmark.png to your html output folder then add the following under the title line as a new line

    Code:
    icon: 'landmark.png',
    For popup infowindows on the landmarks (on Pigmap), showing name, owner and x,y,z coords use this snippet:

    Code:
      function initMarkers() {
        if (markersInit) { return; }
        markersInit = true;
        $.getJSON("/markers.json",
            function(data){
                for (i in data) {
                    createMarker(data[i]);
                }
           });
      }
    
      function createMarker(item) {
    
          var content = "<span style='font-family: sans-serif;'><p><b>" + item.name + "</b></p><p>Owner: " + item.owner + "<br/>Coords: " + item.x + "," + item.y + "," + item.z + "</p></span>";
          var info = new google.maps.InfoWindow({ content: content, });
          var converted = fromWorldToLatLng(item.x, item.y, item.z);
          var marker = new google.maps.Marker({
              position: converted,
              map: map,
              title: item.name + " - " + item.owner,
              icon: 'landmark.png',
          });
          google.maps.event.addListener(marker, 'click', function() {info.open(map, marker);});
      }
    
    Example map: http://minecraft.pleaseignore.com/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  16. Offline

    SinCalChewy

    Hey, awesome plugin! But I'm having one problem...
    I have a separate webserver (apache 2.2) that I run, and then a lighttpd setup on a separate Ubuntu box for my bukkit server. My main server, which is apache, doesn't handle anything related to dynmap/landmarks, it just fowards the request for the map to the other webserver via mod_proxy.

    My problem? If I view the site via the server's direct local URL ( http://192.168.2.155:8123 ), it shows the landmarks. However, if I go through the setup here, which makes it come out to http://mysite.com/map in my case, it doesn't show you the landmarks, but the normal map works as intended as it has.

    Do I need to set up any rewrites or anything to make it work under that setup?
     
  17. Offline

    Liger_XT5

    Out of curiosity, is landmarks working correctly on CB 733?
    I've tried a clean reinstall of dynmap without landmarks, works well, with an exception of the chat.
    I installed landmarks and no one shows up along with no landmark icons.

    This was working before on 714.
     
  18. Offline

    Ratchet

    same problem as Liger_XT5 here, no landmarks showing up for me
     
  19. Offline

    Matalok

    Running v735 here and not a problem. Is the json file getting generated?

    [Edit]

    Also could be a JS error, can you link your map?
     
  20. Offline

    Chris Lewis

    @Matalok
    icon: 'landmark.png', you said add this under the title line? In which file?
    Also is there a way to make icons for each landmark?
     
  21. Offline

    Ratchet

    this is my map
    http://108.60.193.2:8867/
     
  22. Offline

    DFYX

    @Ratchet: your markers.json can't be found. Have you accidentally modified your Landmarks config?

    @SinCalChewy: here's my virtual host config:
    Code:
    NameVirtualHost 78.46.44.20:80
    
    <VirtualHost 78.46.44.20:80>
        ServerName mmxcraft.de
        ServerAlias *.mmxcraft.de
        DocumentRoot /var/rails/eldorado/public
    
        Alias /dynmap /home/minecraft/bukkit/plugins/dynmap/web
        RewriteEngine on
        RewriteRule /dynmap/up/(.*) http://mmxcraft.de:8123/up/$1 [P,L]
    
        DefaultInitEnv RAILS_ENV production
        <Directory "/var/rails/eldorado/public/">
            Options ExecCGI +FollowSymLinks
            AllowOverride All
            order allow,deny
            allow from all
        </Directory>
    
        <Directory /home/minecraft/bukkit/plugins/dynmap/web/>
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    
    <Proxy http://mmxcraft.de:8123/*>
        Order deny,allow
        Allow from all
    </Proxy>
    (Notice that my alias is a little different from what the dynmap wiki says)
     
  23. Offline

    Ratchet

    ah crap my bad. I forgot to put markers.json in the dynmap folder
     
  24. Offline

    SinCalChewy

    If I connect through the apache proxy (actually connecting from my website), the map works fine, however Landmarks doesn't. If I connect to the lighttpd server via the local IP (only I can see this), I can see the Landmarks however.

    Heres my config file for the proxy setup on apache:
    And here is the config for it on the lighttpd server (192.168.2.155):
    When I connect to it via the website, the map works great. Haven't had any other problems until I went to install this plugin. :(
     
  25. Offline

    DFYX

    In the lighthttpd config, change the first line to
    Code:
    alias.url = ( "/dynmap/" => "/opt/minecraft_server/plugins/dynmap/web/" )
    or in your Landmarks config, set markersfile to a markers.json in your lighthttpd dynmap folder
     
  26. Offline

    Ratchet

    nevermind, my landmarks still aren't showing up o.o
     
  27. Offline

    SinCalChewy

    That fixed it, thanks!
     
  28. Offline

    Chris Lewis

    ok so where do i put the line to add the lanmark.jpg? also how do you make different pics for each landmark?
     
  29. Offline

    GGreenBass

    Do you intend to implement this with Notch's maps once they're released? I don't have the dynamap setup working but it would be cool to have this regardless. (Sorry if it was suggested before :<)
     
  30. Offline

    Ratchet

    question; does this only need to be loaded when adding/deleting landmarks, once they're added is it needed to run to display them on dynmap? just thinking about saving RAMspace.
     
  31. Offline

    Matalok

    That would be in the pigmap template.html file in your Pigmap folder.

    Per landmark icons, you could do with a little modification to the plugin, say add a extra entry of "icon" to the JSON file with the location name sanitized (say special chars removed and spaces changed to -) then you could have the JS output that.
     

Share This Page