Coder Social home page Coder Social logo

Comments (8)

samsargent avatar samsargent commented on June 16, 2024

Hi John,

Thanks, I'm glad someone else has found it useful!

If I understand correctly, you just want to get rid of the 'looping' on the x axis when fully zoomed out?

If so, you can just update the javascript in the downloaded file to get rid of the call to getNormalizedCoord when initializing the Google map and instead use:

getTileUrl: function(coord, zoom) {
 /*
 Delete this commented out code:
var normalizedCoord = getNormalizedCoord(coord, zoom);
  if (!normalizedCoord){
    return null;
  }
 var bound = Math.pow(2, zoom); // this can also be removed as it's never used anyway
*/
return url_to_tiles+"/tile_" + zoom + "_" + coord.x + "-" + coord.y + ".png"; 
// NB. normalizedCoord.x & normalizedCoord.y replaced by coord.x & coord.y


}

If the tiles themselves are generated incorrectly than I'm not sure what needs to change sorry :(

Hope that helps!

from google-imagemap-tile-generator.

johndwells avatar johndwells commented on June 16, 2024

Morning,

I've managed to get that far and prevent the map render from "looping"; our issue has more to do with limiting the panning to within the original bounds of our custom map. However since we are operating all the way zoomed out, we can quickly pan into the next "loop" of the sphere.

The best way I can think to avoid this is to keep our zoom at 2 or 3 at the least, and establish our boundary limits by that zoom, so there's no way to pan "back around".

So I've modified the script to allow for a max zoom level of 6, which requires an 8192px square PNG. I've upped my PHP memory to 1.6GB, and execution time to 960. I'm still waiting (patiently). I can keep going higher if that's all it's a matter of.

Any other ideas? I was thinking I might look at the MapTiler app, but since I'm so close with this one I figured I'd press on a bit further!

Cheers,
John

from google-imagemap-tile-generator.

johndwells avatar johndwells commented on June 16, 2024

Hi Sam,

I think I've made progress - I was having tons of trouble getting it to create anything over zoom 5, and finally found this at line 71 of ajaxTiles.php:

if(empty($_POST['levels']) || $_POST['levels'] < 1 || $_POST['levels'] > 5 || empty($_POST['filename']))

I've adjusted that upper limit requirement for $_POST['levels'], and then was fine. I wonder if it'd be worth abstracting that upper limit somehow into a config setting?

Either way, brilliant tool thanks again!

Cheers,
John

from google-imagemap-tile-generator.

samsargent avatar samsargent commented on June 16, 2024

yeah great idea, good to hear you've found a solution.

To be honest I hadn't expected it to get much use so I hadn't thought this far ahead. I've set myself a task to clean it up when I get some time. Config file for settings sounds like a good idea.

I'd say there'd also be a way to restrict the panning in the google maps config.

Here's an example I quickly found which I think is what you're trying to do:
http://jsfiddle.net/yV6xv/33/

It involves fairly complex maths for working out the projection at the various zoom levels and then working out the bounds.

Let me know if/when your project is up, I'd love to check out what you're using it for.

Cheers,
Sam

from google-imagemap-tile-generator.

johndwells avatar johndwells commented on June 16, 2024

Hi Sam,

WOW, that fiddle is far out. Along my journey of setting this custom map up I had read up some on the Projection object, but it was way over my head! But in the end my function is very similar to your boxIn() and it does us well.

The project should be launching next week, I'll definitely share a link.

Thanks again,
John

from google-imagemap-tile-generator.

samsargent avatar samsargent commented on June 16, 2024

Haha, yeah I know, it's not my fiddle, just one I found when searching for
a solution. It's way over my head as well.

Awesome, good luck with the launch!

On 14/09/2012, at 8:04 PM, John D Wells [email protected] wrote:

Hi Sam,

WOW, that fiddle is far out. Along my journey of setting this custom map up
I had read up some on the Projection object, but it was way over my head!
But in the end my function is very similar to your boxIn() and it does us
well.

The project should be launching next week, I'll definitely share a link.

Thanks again,
John


Reply to this email directly or view it on
GitHubhttps://github.com//issues/3#issuecomment-8556824.

from google-imagemap-tile-generator.

johndwells avatar johndwells commented on June 16, 2024

Hi Sam,

Well it took a bit longer than anticipated to get the site launched, but it's finally up. Here's our implementation of custom gmap tiles using your generator:

http://wellington-house.com/location

Thanks again for the help!

Cheers,
John

from google-imagemap-tile-generator.

samsargent avatar samsargent commented on June 16, 2024

A web project taking longer than expected? No way ;)

Wow, nice job. Those markers are awesome. I wanted to do something like that for the initial project I used the generator for but didn't have the time. Thanks for posting the link.

My pleasure, I'm just glad it came in handy.

Cheers,
Sam

from google-imagemap-tile-generator.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.