Page 6 of 8

Re: Providence World Map (WIP)

PostPosted: Fri Jul 11, 2014 1:45 am
by Frakked
alloin wrote:
Frakked wrote:As for making it public... unlikely... unless I can work out a fee based access :) (teasing)

actually not a bad idea, ask silver for a subscription to the map, maybe i could work something out if ppl are interested :p


Pretty sure that would be against User Agreement somewere... deals struck in game are one thing... but access to a website in the Real World... is something else altogether...

So long as it's in-game currency... might work... idk... walking a fine line

Kwaad's got to respond first... and I have to produce...

Absolutely will need to be getting something to reveal what I've paid in time to reveal...

Probably why the effort failed... it was easy to give up tiles when folks were looking for a base... but after?

Think I prophesied this... earlier in the thread

Re: Providence World Map (WIP)

PostPosted: Fri Jul 11, 2014 1:59 pm
by Silushun
IM pretty sure I could host the server for free. I know someone within my household who is a web/graphic designer he'd host it for me and for free no need to greed this for some Salem map tiles haha

Re: Providence World Map (WIP)

PostPosted: Fri Jul 11, 2014 2:01 pm
by Feone
Eh, if costs and people ripping the map tiles for personal maps are an issue you could just put a few ads onto the page and transform the tiles just enough to make them useless for current mapping tools.

Re: Providence World Map (WIP)

PostPosted: Fri Jul 11, 2014 2:05 pm
by Procne
Hasn't Kwaad said already that he can provide hosting and bandwidth? He only needs someone to do the job as he doesn't have time himself.

Re: Providence World Map (WIP)

PostPosted: Fri Jul 11, 2014 3:02 pm
by alloin
mapping a FULL worldmap is not a pleasant and easy task, it also takes a fair bit of your time, hence nobody wants to maintain one...

I have hosting & all scripts working with dynamic markers & a login system, i just can't be arsed to maintain it, unless i gain something out of it.

Re: Providence World Map (WIP)

PostPosted: Sat Jul 12, 2014 5:12 am
by imrielle
JS for a map:
Code: Select all
var COORDSPP = 5.12;
var map;
var projection;
var cnames = new Array("/");
myProjection.prototype.fromPointToCoord = function(point) {return new Coord(COORDSPP*point.x, COORDSPP*point.y)};
myProjection.prototype.fromCoordToPoint = function(coord) {return new google.maps.Point(coord.x/COORDSPP, coord.y/COORDSPP);};
myProjection.prototype.fromLatLngToCoord = function(latLng) {return this.fromPointToCoord(this.fromLatLngToPoint(latLng))};
myProjection.prototype.fromCoordToLatLng = function(coord) {return this.fromPointToLatLng(this.fromCoordToPoint(coord))};

myProjection.prototype.fromLatLngToPoint = function(latLng) {
   var origin = this.worldOrigin_;
   var x = origin.x + latLng.lng() * this.pixelsPerLonDegree_;
   var y = origin.y + latLng.lat() * this.pixelsPerLatDegree_;
   return new google.maps.Point(x, y);
};

myProjection.prototype.fromPointToLatLng = function(point) {
   var origin = this.worldOrigin_;
   var lng = (point.x - origin.x) / this.pixelsPerLonDegree_;
   var lat = (point.y - origin.y) / this.pixelsPerLatDegree_;
   return new google.maps.LatLng(lat, lng);
};

function myProjection() {
   var MAP_RANGE = 51200;
   this.worldOrigin_ = this.fromCoordToPoint(new Coord(gup("x","0"),gup("y","0")));
   this.pixelsPerLonDegree_ = MAP_RANGE / 360;
   this.pixelsPerLatDegree_ = MAP_RANGE / 180;
};

function CoordMapType(tileSize) {
   this.tileSize = tileSize;
}

//Something with the overlay grid
CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
   switch(zoom) {
   case 9:
   default:
      var factor = Math.pow(2,(9-zoom))
      var div = ownerDocument.createElement('DIV');
      div.style.fontSize = '10pt';
      div.style.borderStyle = 'solid';
      div.style.borderWidth = '1px 0px 0px 1px';
      div.style.borderColor = '#222222';
      div.style.color = '#CCCCCC';
      div.innerHTML = "("+coord.x*factor+", "+coord.y*factor+")";
      div.style.width = this.tileSize.width + 'px';
      div.style.height = this.tileSize.height + 'px';
      return div;
      break;
   }
};

//Draw a button in the top right corner
function ButtonControl(map, title, html, func) {
   var controlDiv = document.createElement('DIV');
   var controlUI = document.createElement('DIV');
   var controlText = document.createElement('DIV');
   controlDiv.appendChild(controlUI);
   controlUI.appendChild(controlText);
   controlText.title = title;
   controlText.innerHTML = html;
   controlDiv.className = 'controlDiv';
   controlUI.className = 'controlUI';
   controlText.className = 'controlText';
   map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv);
   google.maps.event.addDomListener(controlUI, 'click', func);
}


function initialize() {

   var myMapType = new google.maps.ImageMapType({
      tileSize: new google.maps.Size(100, 100),
      minZoom: 1,
      maxZoom: 9,
      zIndex: 0,
      getTileUrl: function(coord, zoom) {
         return 'https://googledrive.com/host/0B4fMn0hnHw64N1NiQVVyYUlwdGc/'+ zoom + '/tile_' + coord.x + '_' + coord.y + '.png';
      },
      isPng: true
   });

   projection = new myProjection();
   myMapType.projection = projection

   var mapOptions = {
      center: new google.maps.LatLng(0, 0),
      mapTypeControl: false,
      backgroundColor: '#555555',
      zoom: parseInt(gup("zoom","4")),
      streetViewControl: false
   };

   map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
   map.mapTypes.set('myMapType', myMapType);
   map.setMapTypeId('myMapType');
   map.submap = parseInt(gup("map","1"));

   //addMarker();

   // GridControl
   new ButtonControl(map, "Grid Off/On", "Grid Off/On", function() {
      if (map.overlayMapTypes.getLength()) {
         map.overlayMapTypes.pop();
      }   else {
         map.overlayMapTypes.push(new CoordMapType(new google.maps.Size(100, 100)))
      }
   });
   
   // Location URL
   google.maps.event.addListener(map, 'bounds_changed', function() {
      coord = projection.fromLatLngToCoord(map.getCenter());
      url = "/"+
            "?x="+Math.round(coord.x*100)/100+
            "&y="+Math.round(coord.y*100)/100+
            "&zoom="+map.zoom;
      document.getElementById("location").innerHTML = url;
   });
}

//Get URL Parameter
function gup(name,dflt) {
   name = name.replace(/[[]/,"\\\[").replace(/[]]/,"\\\]");
   var regexS = "[?#&]"+name+"=([^&#]*)";
   var regex = new RegExp( regexS );
   var results = regex.exec( window.location.href );
   if( results == null )
      return dflt;
   else
      return results[1];
}

    google.maps.event.addListener(map, "click", function(event) {
        marker = new google.maps.Marker({
          position: event.latLng,
          map: map
        });
        google.maps.event.addListener(marker, "click", function() {
          infowindow.open(map, marker);
        });
    });


extend.js
Code: Select all
function extend(subClass, baseClass) {
   function inheritance() {}
   inheritance.prototype = baseClass.prototype;

   subClass.prototype = new inheritance();
   subClass.prototype.constructor = subClass;
   subClass.baseConstructor = baseClass;
   subClass.superClass = baseClass.prototype;
}

function Coord() {
   this.x;
   this.y;
}

function Coord(x,y) {
   this.x = x;
   this.y = y;
}

Coord.prototype.toString = function() {
   return "("+this.x+", "+this.y+")";
}


HTML:
Code: Select all
<!DOCTYPE html>
      <html>
      <head>
      <title>Stonewell</title>
      <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
      <link href="style/style.css" type="text/css" rel="stylesheet">
      <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
      <script type="text/javascript" src="data/extend.js"></script>
      <script type="text/javascript" src="data/markers.js"></script>
      <script type="text/javascript" src="data/map.js"></script>
      </head>
      <body onload="initialize()">
         <div id="map_canvas"></div>
   <div id="location"></div>
      </body>
      </html>


Markers example:
Code: Select all
var markers = [
//Type/Name, Quality, X, Y, zIndex
   ['Ball Clay', 'Q27+', -3, 3, 9410],
   ['Acre Clay', 'Q22', -3, 4, 9510],
   ['Acre Clay', 'Q22', -3, 4, 9510]
];


Looks like: http://voleur.host22.com/map.php
Tiles: https://drive.google.com/file/d/0B4fMn0 ... sp=sharing (not including the zoom levels). You can find the scripting for zoomlevels elsewhere in this forum.

This was my private map. I was supposed to get a copy of Kwaad's tiles, but he had never PM'd me the link. This is no longer maintained (I don't currently play).

Re: Providence World Map (WIP)

PostPosted: Sat Jul 12, 2014 8:11 am
by KruskDaMangled
alloin wrote:mapping a FULL worldmap is not a pleasant and easy task, it also takes a fair bit of your time, hence nobody wants to maintain one...

I have hosting & all scripts working with dynamic markers & a login system, i just can't be arsed to maintain it, unless i gain something out of it.


A feeling of satisfaction at having been useful? I don't think anyone is going to pay you cash money for the service, sadly.

Re: Providence World Map (WIP)

PostPosted: Sat Jul 12, 2014 12:25 pm
by alloin
KruskDaMangled wrote:
alloin wrote:mapping a FULL worldmap is not a pleasant and easy task, it also takes a fair bit of your time, hence nobody wants to maintain one...

I have hosting & all scripts working with dynamic markers & a login system, i just can't be arsed to maintain it, unless i gain something out of it.


A feeling of satisfaction at having been useful? I don't think anyone is going to pay you cash money for the service, sadly.

Image

Re: Providence World Map (WIP)

PostPosted: Wed Aug 13, 2014 4:16 pm
by pestilence456
Why markers don't work?
pls help how i can fix it?

Re: Providence World Map (WIP)

PostPosted: Sat Aug 16, 2014 3:17 pm
by Doomer3003
It's just too bad that the community is greedy like that...