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 7057403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:58:55+00:00 2026-05-28T03:58:55+00:00

I’m making an app that will show the current location in a map, but

  • 0

I’m making an app that will show the current location in a map, but this map is a image (not google maps). How can i do that? Use a map that is not google maps.

I’m wondering if is possible, somehow, to relate the google maps coordinates with this map i want to use, using core location to get these coordinates.

Any ideias?

  • 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-05-28T03:58:55+00:00Added an answer on May 28, 2026 at 3:58 am

    Here is a class I created for latitude/longitude conversions for both FAI globe and WGS-84 projections. You initialize it with a base geographic point (say: the center of your map), and it will compute distance in meters between that point and other points. If you then know the meters/pixel resolution of your map, you can easily convert it to pixel values.

    The class is not very much documented, but I know you can figure it out. It uses another class of mine (Vector), but you should be able to replace that with CGPoint easily.

    CAVEAT: it will not work with small scale maps. It is optimized for quick computing time assuming a large scale map (say: smaller than 100km across).

    The .h file:

    //
    //  Earth.h
    //
    //  Created by René Dekker on 01/10/2011.
    //  Copyright 2011. All rights reserved.
    //
    
    #import <Foundation/Foundation.h>
    #import <CoreLocation/CoreLocation.h>
    #import "Vector.h"
    
    enum EarthModel {
        EarthModelFAI = 0,
        EarthModelWGS84 = 1
    };
    
    @interface Earth : NSObject {
        enum EarthModel theModel;
        double theLongitudeScale;
        double theLatitudeScale;
        CLLocationCoordinate2D baseLocation;
    }
    
    @property CLLocationCoordinate2D baseLocation;
    
    + (Earth *)earthModel:(enum EarthModel)model atLatitude:(double)baseLatitude;
    - (void) rebaseAtLatitude:(double)baseLatitude;
    
    + (Earth *)earthAtLocation:(CLLocationCoordinate2D)location model:(enum EarthModel)model;
    - (void) rebaseAtLocation:(CLLocationCoordinate2D)location;
    
    - (Vector *) differenceBetween:(CLLocationCoordinate2D)first and:(CLLocationCoordinate2D)second;
    - (double) distanceBetween:(CLLocationCoordinate2D)first and:(CLLocationCoordinate2D)second;
    - (CLLocationCoordinate2D) addTo:(CLLocationCoordinate2D)location vector:(Vector *)vector;
    - (double) addToLongitude:(double)longitude distance:(double)distance;
    - (double) addToLatitude:(double)latitude distance:(double)distance;
    
    - (Vector *) vectorFromBase:(CLLocationCoordinate2D)location;
    - (double) distanceFromBase:(CLLocationCoordinate2D)location;
    - (CLLocationCoordinate2D) addToBase:(Vector *)vector;
    
    @end
    

    The .m file:

    //
    //  Earth.m
    //
    //  Created by René Dekker on 01/10/2011.
    //  Copyright 2011. All rights reserved.
    //
    // The information and formulas used in the WGS84 computations come mainly from:
    // http://en.wikipedia.org/wiki/World_Geodetic_System
    // http://en.wikipedia.org/wiki/Meridian_arc#Meridian_distance_on_the_ellipsoid
    // http://www.holoscenes.com/cgi-bin/moin.cgi/Ellipsoid
    // http://www.movable-type.co.uk/scripts/gis-faq-5.1.html
    // http://williams.best.vwh.net/avform.htm
    // 
    
    #import "Earth.h"
    
    #define WGS_EQUATOR_R   6378137.0
    #define WGS_POLAR_R     6356752.314245
    #define F               (1/298.257223563)
    #define E2              (F * (2 - F))
    #define FAI_R           6371000
    
    @implementation Earth
    
    double modTo(double x, double lower, double upper)
    {
        double range = upper - lower;
        double result = fmod(x - lower, range);
        if (result < 0) {
            result += range;
        }
        return result + lower;
    }
    
    
    - (void) rebaseAtLatitude:(double)baseLatitude
    {
        baseLatitude *= PI_DEGREE;
        if (theModel == EarthModelWGS84) {
            double sinLat = sin(baseLatitude);
            double factor = sqrt(1 - E2*sinLat*sinLat);
            theLatitudeScale = PI_DEGREE * WGS_EQUATOR_R * (1-E2) / pow(factor, 3);
            theLongitudeScale = PI_DEGREE * WGS_EQUATOR_R * cos(baseLatitude) / factor;
        } else {
            theLatitudeScale = PI_DEGREE * FAI_R;
            theLongitudeScale = PI_DEGREE * FAI_R * cos(baseLatitude);
        }
    }
    
    - (void) rebaseAtLocation:(CLLocationCoordinate2D)location
    {
        baseLocation = location;
        [self rebaseAtLatitude:location.latitude];
    }
    
    - (CLLocationCoordinate2D) baseLocation
    {
        return baseLocation;
    }
    
    - (void) setBaseLocation:(CLLocationCoordinate2D)location
    {
        baseLocation = location;
        [self rebaseAtLatitude:location.latitude];
    }
    
    - (Earth *) initWithModel:(enum EarthModel)model atLocation:(CLLocationCoordinate2D)location
    {
        if (!(self = [super init])) {
            return nil;
        }
        theModel = model;
        [self rebaseAtLocation:location];
        return self;
    }
    
    + (Earth *)earthModel:(enum EarthModel)model atLatitude:(double)baseLatitude
    {
        CLLocationCoordinate2D location = CLLocationCoordinate2DMake(baseLatitude, 0);
        return [[[Earth alloc] initWithModel:model atLocation:location] autorelease];
    }
    
    + (Earth *)earthAtLocation:(CLLocationCoordinate2D)location model:(enum EarthModel)model
    {
        return [[[Earth alloc] initWithModel:model atLocation:location] autorelease];
    }
    
    - (Vector *) differenceBetween:(CLLocationCoordinate2D)first and:(CLLocationCoordinate2D)second
    {
        double dx = modTo(first.longitude - second.longitude, -180, 180) * theLongitudeScale;
        double dy = (first.latitude - second.latitude) * theLatitudeScale;
        return [Vector withX:dx y:dy];
    }
    
    - (double) distanceBetween:(CLLocationCoordinate2D)first and:(CLLocationCoordinate2D)second
    {
        double dx = modTo(first.longitude - second.longitude, -180, 180) * theLongitudeScale;
        double dy = (first.latitude - second.latitude) * theLatitudeScale;
        return hypot(dx, dy);
    }
    
    - (CLLocationCoordinate2D) addTo:(CLLocationCoordinate2D)location vector:(Vector *)vector
    {
        location.latitude += vector.y / theLatitudeScale;
        location.longitude += modTo(vector.x / theLongitudeScale, -180, 180);
        return location;
    }
    
    - (Vector *) vectorFromBase:(CLLocationCoordinate2D)location
    {
        return [self differenceBetween:location and:baseLocation];
    }
    
    - (double) distanceFromBase:(CLLocationCoordinate2D)location
    {
        return [self distanceBetween:location and:baseLocation];
    }
    
    - (CLLocationCoordinate2D) addToBase:(Vector *)vector
    {
        return [self addTo:baseLocation vector:vector];
    }
    
    - (double) addToLongitude:(double)longitude distance:(double)distance
    {
        return modTo(longitude + distance / theLongitudeScale, -180, 180);
    }
    
    - (double) addToLatitude:(double)latitude distance:(double)distance
    {
        return latitude + distance / theLatitudeScale;
    }
    
    - (NSString *) description
    {
        return NSStringFromCLLocationCoordinate2D(baseLocation);
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm making a simple page using Google Maps API 3. My first. One marker
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.