Results 1 to 6 of 6

Thread: photoshop google tile cutter script not working

  1. #1
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default photoshop google tile cutter script not working

    Hello,


    I found a script online that will cut my image into tiles in photoshop to be used in the google maps style.

    everything worked great there the tiles were put into a folder and an index.html was made everything works great in my browser but when I put the html code into my web page all that happens is a blank spot saying loading tiles.

    here is my INDEX.HTML

    Code:
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<title>Archlord World Map</title>
    		<meta charset="utf-8" />
    		<style>
    			html, body {
    				height: 100%;
    				margin: 0;
    				padding: 0;
    			}
    			#map {
    				width:100%;
    				height:100%;
    				color: #CCC;
    				background: #EFEFEF;
    			}
    			span.loading {
    				display: block;
    				text-align: center;
    				font: 300 italic 72px/400px "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
    			}
    		</style>
    	</head>
    	<body>
    		<div id="map"><span class="loading">loading tiles...</span></div>
    		<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    		<script>
    
    
    			/*
    			 * = PS_Bramus.GoogleMapsTileCutter Config
    			 * ----------------
    			 */
    
    				var repeatOnXAxis = false; // Do we need to repeat the image on the X-axis? Most likely you'll want to set this to false
    
    
    
    			/*
    			 * Helper function which normalizes the coords so that tiles can repeat across the X-axis (horizontally) like the standard Google map tiles.
    			 * ----------------
    			 */
    
    				function getNormalizedCoord(coord, zoom) {
    					if (!repeatOnXAxis) return coord;
    
    					var y = coord.y;
    					var x = coord.x;
    
    					// tile range in one direction range is dependent on zoom level
    					// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
    					var tileRange = 1 << zoom;
    
    					// don't repeat across Y-axis (vertically)
    					if (y < 0 || y >= tileRange) {
    						return null;
    					}
    
    					// repeat across X-axis
    					if (x < 0 || x >= tileRange) {
    						x = (x % tileRange + tileRange) % tileRange;
    					}
    
    					return {
    						x: x,
    						y: y
    					};
    
    				}
    
    
    			/*
    			 * Main Core
    			 * ----------------
    			 */
    
    				window.onload = function() {
    
    					// Define our custom map type
    					var customMapType = new google.maps.ImageMapType({
    						getTileUrl: function(coord, zoom) {
    							var normalizedCoord = getNormalizedCoord(coord, zoom);
    							if(normalizedCoord && (normalizedCoord.x < Math.pow(2, zoom)) && (normalizedCoord.x > -1) && (normalizedCoord.y < Math.pow(2, zoom)) && (normalizedCoord.y > -1)) {
    								return zoom + '_' + normalizedCoord.x + '_' + normalizedCoord.y + '.jpg';
    							} else {
    								return 'empty.jpg';
    							}
    						},
    						tileSize: new google.maps.Size(256, 256),
    						maxZoom: 5,
    						name: 'PS_Bramus.GoogleMapsTileCutter'
    					});
    
    					// Basic options for our map
    					var myOptions = {
    						center: new google.maps.LatLng(0, 0),
    						zoom: 2,
    						minZoom: 0,
    						streetViewControl: false,
    						mapTypeControl: false,
    						mapTypeControlOptions: {
    							mapTypeIds: ["custom"]
    						}
    					};
    
    					// Init the map and hook our custom map type to it
    					var map = new google.maps.Map(document.getElementById('map'), myOptions);
    					map.mapTypes.set('custom', customMapType);
    					map.setMapTypeId('custom');
    
    				}
    		</script>
    
    	</body>
    </html>

    HERE is my files

  2. #2
    Join Date
    Jan 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've got the same issue
    can anyone help us?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd try an iframe.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    I'd try an iframe.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

    That is the code,I don't even know how to get it working on my site, do I have to upload the folder with all the tiles and the index.html somewhere ? where in the code do I link to my tiles ?

    all I have done at this point is process the script in photoshop it then spat out all the tiles and a index.html which is posted in my first post.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You do need to upload all of the files required in order to get it to work, yes.

    You said it worked as just index.html:

    everything worked great there the tiles were put into a folder and an index.html was made everything works great in my browser
    As long as that works, if you were to upload all of those files to their own folder(s) just like it is on the local machine, it should be fine. Then putting that index page inside of an iframe on your other page where you want it to appear should also work.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jan 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ill try it out, Been a long time since I built a webpage from a cpanel host forget what to do, have an account at atspace.com but just trying to figure out how and where I put my html and scripts in etc. Lacking the experience in setting up websites through one of them hosts
    Last edited by kips; 02-07-2014 at 02:18 PM.

Similar Threads

  1. Conveyor belt slideshow script not working in Google Chrome
    By ArnyVee in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 07-17-2010, 01:19 PM
  2. The page cutter script
    By bbilal in forum Looking for such a script or service
    Replies: 4
    Last Post: 02-02-2008, 11:38 AM
  3. PHP Album - Changing pop up background colors/colours, tile bar, path etc
    By PhoenixGB in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 05-28-2007, 07:15 PM
  4. Adding a background and have it tile
    By DreamGirlB in forum Graphics
    Replies: 10
    Last Post: 07-25-2006, 03:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •