Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:16:41+00:00 2026-06-14T10:16:41+00:00

I have created a custom map using the Google Maps API v3. It’s a

  • 0

I have created a custom map using the Google Maps API v3. It’s a rectangular map of a fictional world, not of anything in the real world.

I have been reading articles on how to use Projections in custom Google Maps. I need to use a Projection because placing Markers and Regions using Projections, they do not repeat horizontally. Anyways, I pulled the following code from a tutorial:

var tilesize = 256;

function MyProjection(){}

MyProjection.prototype.fromLatLngToPoint = function(latLng)
{
    var x = latLng.lng() * tileSize;
    var y = latLng.lat() * tileSize;
    return new google.maps.Point(x, y);
};

MyProjection.prototype.fromPointToLatLng = function(point)
{
    var lng = point.x * (1.0 / tileSize);
    var lat = point.y * (1.0 / tileSize);
    return new google.maps.LatLng(lat, lng);
};

function LatLngToPixels(latLng)
{
    var pnt = MyProjection.prototype.fromLatLngToPoint(latLng);
    return [pnt.x * 8, pnt.y * 8];
}

function PixelsToLatLng(pxs)
{
    var pnt = {x: pxs[0] / 8, y: pxs[1] / 8};
    return MyProjection.prototype.fromPointToLatLng(pnt);
}

I’ve applied it to my map and it seems to work. However, I’m trying to figure out how to alter the scale of the projection. When I place a marker like this:

new google.maps.Marker(
{
    map: map,
    position: new google.maps.LatLng(0, 0)
});

The marker is placed at the top left corner of the map. If I do this:

new google.maps.Marker(
{
    map: map,
    position: new google.maps.LatLng(1, 1)
});

the marker is placed at the bottom right.

So I basically have a minimum longitude and latitude of 0 and a max of 1 to work with. How can I alter the above functions so that the scale is a bit more managable? Like 0 to 90 or 0 to 180? Something that makes a bit more sense in terms of real-world longitude and latitude coordinates? Or is that not possible with Projections? I’m a bit confused by the idea of projections and what exactly their ultimate purpose is so maybe I’m missing the point…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:16:42+00:00Added an answer on June 14, 2026 at 10:16 am

    The purpose of a projection is to display a 3D object, (like a planet), on a 2D surface, (like a piece of paper or a computer screen).

    Here is a Google example that contains a Mercator projection object. Note that the Google Maps API V3 uses the concept of World Coordinates with which the entire world is represented on a single tile of 256×256 pixels at zoom level 0, and then scaled up according to the zoom level, so that

    pixelCoordinate = worldCoordinate * Math.pow(2,zoomLevel)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using google maps API 3 and a custom overlay (OverlayView) I have this
I have a Google map I created in Javascript using the v3.8 api: var
I created a map using Google Maps API that highlights all Minnesota counties. Basically,
I need to create custom pathways using the Google Maps API V3 for a
I have a Google Map created with V3 API, and I wish to apply
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have found a code to show Google maps with multiple markers using JQuery
I have a Google map I have created to highlight the location of several
Hi i have created a custom converter in jsf for combo box using h:selectOneMenu,
I'm trying to add a ground overlay to a custom map and have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.