[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

    SBHouse

    Is there any chance that this JSON file could be utilized by pigmap? MineOS CRUX now allows you to build pigmaps fairly easily and I'm going to be publishing those for my players on a regular basis.
     
  3. Offline

    kaynide

    Hey! There is a way to make the images whatever size you want, but they've all got to be the same size (no problem, just make a big empty space with the smaller icon centered).

    In the css folder, load up landmarks.css. The first line looks like the following (My numbers match my custom stuff):

    Code:
    .dynmap .landmarkMarker {
      width: 35px;
      height: 35px;
      padding: 0px;
      margin-top: -17px;
      margin-left: -17px;
      position: absolute;
      background-image:url(../images/landmark_default.png);
    }
    the margin info is actually about centering, so it should basically be whatever width and height are, divided by -2.
    Note that this will make the icons in the top right list a little funky, but those can be turned off by adding:
    Code:
    UL.landmarklist LI {background:none!important;}
    
    to the bottom of landmarks.css

    Sorry, unsure about how to add the enable/disable. Hope this helps a little.
     
  4. I'm sure it can be done somehow, but at first glance I don't see how pigmap stores the in-game coordinates into the map... The json file works with the in-game coordinate system, so you need a way to figure out where those coordinates are on the map that is being displayed. If this information is somehow stored somewhere (which I haven't checked), it would be relatively easy for somebody that knows javascript well enough to add support for these json files. I don't use pigmap though, so I won't do it myself :)

    Actually, I can quite easily add support for any-size-icons (even different sizes mixed). I'll put it on the to-do list ;)

    I proudly present: Landmarks 0.4!

    This is pretty much a full rewrite of the original, almost none of the original code is left intact. It is fully backwards-compatible still, though!

    First, the downloads:
    Landmarks.jar version 0.4
    web files in .zip format

    Yes - you saw that correctly, also an updated .jar.

    Changes to the web part:
    - Support for mixed icon sized - no configuration needed, just drop them in the same way as other icons.
    - Support for making lists based on type (you cannot turn this feature off for right now - does anyone WANT to turn it off?)
    - Support for toggling types on/off by clicking the type header.

    Changes to the .jar part:
    - Changed the commands:
    /landmark <name>
    Sets or modifies the landmark with name <name>, setting type to Default.
    /landmarktyped <type> <name>
    Sets or modifies the landmark with name <name>, setting type to <type>.
    /landmarksettype <type> <name>
    Changes type of landmark <name> to <type>, without changing the location of the landmark.
    /landmarkdelete <name>
    Exactly what you think it does.
    /landmarklook <name>
    Aims your vision towards landmark <name>. This does not check what world the landmark is in, currently, so it only works on landmarks in the same world as the player. Handy for remembering what is where when in-game.
    /landmarkwarp <name>
    Teleports you to landmark <name>. This is multi-world compatible.
    /landmarklist
    Shows a full list of all landmarks and their types/locations.

    The list/delete/settype commands are available from the console, others only in-game (which makes sense, if you think about it).

    Permissions:
    All old permissions still work as they did (except the .remove permission, which I merged with .modify - you now need .modify to delete a landmark, no longer .remove), and I added some new ones:
    landmark.modify.<name> - allows player to modify/delete landmark <name>. Lowercase, change spaces into underscores. (for example, to allow somebody to modify/delete the landmark "The Birds Nest", give them permission "landmark.modify.the_birds_nest")
    landmark.look.all - Allows use of the /landmarklook command on all landmarks.
    landmark.look.own - Allows use of the /landmarklook command on all own landmarks.
    landmark.look.<name> - Like the landmark.modify.<name> permission, but for the /landmarklook command.
    landmark.warp.all - Allows use of the /landmarkwarp command on all landmarks.
    landmark.warp.own - Allows use of the /landmarkwarp command on all own landmarks.
    landmark.warp.<name> - Exactly what you think it does.

    Hopefully everyone will enjoy this "upgrade" :)
    Oh, and full sourcecode is available here.

    Of course the same as before is in effect - anyone may "steal" this work, no need to ask for permission.

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

    SPUKI11

    Thank you! Everything works beautifully !!!!!
     
  6. Offline

    Massimo1993

    @Thulinma

    hi excuse me but the version 0.4 don't work:

    i cant create landmark and the player and the time don't work
     
  7. In case anyone else besides Massimo1993 runs into this:

    My version has no settings panel, so do not add

    - class: org.dynmap.ClientComponent
    type: settings

    To your dynmap config for 0.4! Doing so might break the map in some browsers, due to it trying to load a nonexistent script.
     
  8. Offline

    Massimo1993

    yes but i've add
    - class: org.dynmap.ClientComponent type: landmarks

    but don't work:

    i cant create landmar and i can't view time, user and chat
     
  9. Can you load up the dynmap page with firebug or javascript console open, and post a list of any errors that show up? Also - I assume you are using the newest dynmap version, right?
     
  10. Offline

    Massimo1993

  11. I noticed:
    [17:00:00.417] GET http://localhost:8123/js/landmarks.js [HTTP/1.1 404 Not Found 28ms]

    Did you maybe forget to upload the files from the .zip to your dynmap/web folder?

    As for the error writing the landmarks file - is the file maybe set to read-only? If not, try deleting it and then reloading the server, that might help too.
     
  12. Offline

    Massimo1993

    @Thulinma
    ooooooooo ok i've resolved. im need to put on web file xD i've only extract the dynmap folder and put in plugin. you need to reedit the rar and add the folder css js image in a web folder

    edit: ok now the dynmap work but i continue receive this error:

    [GRAVE] [Landmarks] Error writing markers file.
     
  13. Have you tried my original suggestion of deleting the json file and then reloading the server? That should fix any issues with not being able to save it. Also make sure the server process has write access to the data folder.
     
  14. Offline

    Massimo1993

    @Thulinma

    ok, i've resolved: i've creted a folder: Landmarks and i've write a config.yml

    Code:
    markersfile: C:\Users\Massimo\Desktop\server\plugins\Landmarks\Landmarksmarkers.json

    but now i can't visualized the landmarks in dynmap: he create the landmark but i can't view
     
  15. Try this as config:

    markersfile: ../dynmap/web/markers.json

    The markersfile needs to be called markers.json and needs to be in the dynmap/web folder, otherwise the javascript part doesn't work. I'll see if I can make all this easier to setup for first-time users...
     
  16. Offline

    Massimo1993


    ok now work tnks a lot xD
     
  17. Offline

    SPUKI11

    Hi, how can I select other Icons? In the folder /web/images is landmark_house.jpg and landmark_default.png. how I select the Icons?

    I give one:
    /landmarksettype default MyHouseLandmarkName
    and only then comes
    Landmarktype MyHouseLandmarkName is change to default

    ?!?! But the icon is the same
     
  18. try this, instead:

    /landmarksettype house MyHouseLandmarkName

    The icon will then change to the landmark_house.png file.
    If you want something else, for example landmark_test.png, put the file in that folder and use this command instead:

    /landmarksettype test MyHouseLandmarkName

    Makes sense, right?
    You can also use /landmarktyped to set a new landmark with a specific type instead of changing the type afterwards.
     
  19. Offline

    SPUKI11

    Thank you it worked!!! :D Does anyone have such icon of bank, train airport, etc.?
     
  20. Offline

    kaynide

    Great upgrade! Thanks!!
    I would only ask that the default help info is shown (type /landmark and get a list of commands).

    Good stuff!

    Made some adjustments to the code to help with visibility; I recommend it to anyone who's interested!
    At the very bottom, replace some of the code in landmarks.css with the following:

    Code:
    .landmarklist{
      max-height:300px;
      overflow:auto;
      list-style-type: none;
      padding:0px;
      margin:0px;
    }
    .landmarktype li{
      line-height:14px;
      overflow-x:hidden;
      cursor:pointer;
      padding-left:20px!important;
    background-color: #bbb;
    color: #000000;
    }
    .landmarktypename{
      overflow-x:hidden;
      cursor:pointer;
    font-weight: bold;
    font-size: 20px;
    color: #cccc00;
    padding-right: 50px;
    }
    .landmarktypename:hover{
      color:red;
    }
    .landmarktype li:hover{
      color:red;
    background-color: #ffffff;
    }
    
    It'll make the types bigger, "goldish" color and bold, it'll also make the individual points have a gray background (same color as the zoom buttons) and highlight to white (as the zoom buttons do).
    In addition, because of the colored background you can see the cool effects when you hide a type (didn't even realize it was in the code since the backgrounds were originally the same!)

    Again, thanks a million for updating this!! It's moved from "simply a nice plugin" to absolutely critical to my players. You've made a lot of people happy!!

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

    Valiant

    here is my problem!
    It is not publishing the landmarks to dynmap.
    This is the map.
    http://noblevi.net/mcmap
    As you can see, it does have the "Landmarks" section on the right pull out menu
    Im not sure what I did wrong.
    I added the class arguments to the config file as well.
    This isnt exactly how I did it, but jst so I dont have to go back to by FTP to copy and paste,
    Components:
    -The class you said to put above the first one
    -The first class you explain about in the setup.
    - All the classes that were already there to begin with.

    Yes I did copy all the right files to the right places with the dynmap folder. I double triple quadruple checked this. Thank you for any help!
     
  22. Location of markers.json? Config file pointing to markers.json? That's not a port, I assume you're using inline code to make your map show up, and it's pointing to the dynmap port, and not being hosted on apache or something, is it? If it is being hosted on apache/something else, how are you dealing with the markers.json? Which downloads did you grab for the .jar and any other files?
     
  23. Offline

    Valiant

    No, I am directly hosting it straight out of the box. Not on a apache. (my minecraft server is hosted by a company that uses ftp)

    Aslo, if this helps at all...
    When there are no players connected, all the settings for landmarks in the dynmap menu are seen. As soon as a person connects, and it is displayed on the map, those options dissapear and the "Landmarks" title drops to the bottom of the menu.

    The landmarks are not viewable still at any time

    Also, lol
    When deleting the Json file. And reloading the server... IT does not re-make the file
     
  24. Offline

    kaynide

    Request!
    So far this is amazing. Would like to see some kind of "If there are no landmarks, don't show category" option (ie no "house" icons = "house" as a category not shown.
    Great stuff!
     
  25. Release 0.5 is out!
    Same download links as before:
    Landmarks.jar
    dynmap webfiles

    Of course the changes are also in the git repo.

    Jarfile changes since 0.4:
    - Fixed creation of directories, if needed (fixes re-creating markers.json file if deleted/doesn't exist)
    - Changed default markers.json location to dynmap/web/markers.json, if no config file overwrite has been done (was landmarks/markers.json)

    Webfiles changes since 0.4:
    - Changed looks of landmark list to match the rest of the interface
    - Fixed bug that caused some unused landmark types to show up in the list sometimes
    - Types are no longer shown as sublist if there is only one landmark of the type
    - Fixed live handling of landmarks changing types
    - Fixed live handling of landmark deletions
    - Fixed inner sorting of sublists

    You seem to not have landmarks in your dynmap config (the "component"). It's not loading the script at all, anyway. Also make sure you use at least 0.3 or later.... the 0.2 version does not support the version of dynmap you are using.

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

    BloppyBuilder

    Great job on this plugin Thulinma ! Glad that you are keeping it alive :)

    I have a little problem, i'm using the last version 0.5 and the tip that you have done before to hide the icons on the top right of the dynmap menu, doesn't work for me :S

    ( Put this line at the bottom of the landmark.css file : UL.landmarklist LI {background:none!important;} )


    I have big icons and the menu is uggly like this, please find a solution!


    Thanks
     
  27. Yes, the CSS changed some. Now, to do this, you need:

    Code:
    UL.landmarklist LI IMG{display:none!important;}
    UL.landmarktype LI IMG{display:none!important;}
    The first line will hide the icons in front of group names, the second line will hide icons in front of landmarks that do not have a foldable group they are listed in. You can use just one line or both in any combination. Just add to the bottom of the CSS file.
     
  28. Offline

    neXorianus

    @Thulinma
    thank you for your great work, but Please, start a new topic... its kinda anoying, if you have to search all the posts for the latest working version.
    split from the original landmark... at least until the main developers of the "original" landmark plugin are back.
    *downloading your version*
     
  29. Offline

    DetCox

  30. Offline

    jeremytrains

    Can anyone help me?? I have installed LandMarks and DynMap correctly, but when I make a landmark, it says "..landmark saved/created...". Then, when I look at my DynMap, NOTHING HAPPENS! NO LANDMARK! I have added the components correctly. Can anyone help me? I see nothing like a landmark on my dynmap
     

Share This Page