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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:06:13+00:00 2026-06-06T22:06:13+00:00

currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView

  • 0

currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView to present a map which is provided by my own tileserver.
I`m using OpenLayers to show this map and now I want to use a Text Layer to show some custom POI`s.
Unfortunately, the map uses 90013 projection:

map = new OpenLayers.Map ("map", {
            controls:[
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.Permalink(),
                new OpenLayers.Control.ScaleLine({geodesic: true}),
                new OpenLayers.Control.Permalink('permalink'),
                new OpenLayers.Control.MousePosition(),                    
                new OpenLayers.Control.Attribution()],
            //maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
            maxResolution: 156543.0339,
            numZoomLevels: 19,
            units: 'm',
            projection: new OpenLayers.Projection("EPSG:900913"),
            displayProjection: new OpenLayers.Projection("EPSG:900913")
        } );

So when I want to display the Markes provided by the TextLayer, I have to use coordinates in the right format. To center the map is easy:

var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
            map.setCenter (lonLat, zoom);

But how can I do this transformation automatically for the TextLayer? I want to have the lat lon values according to the well-known EPSG4326 into the Text Layer data file (columns lat long) and not the values according to 900913 (what I`m doing at the moment to have it work).

Is there a way to let OpenLayers transform the Text Layer`s coordinates automatically to the format used in the map? Maybe a callback function to override like onShow?

Thanks for your help!
Otherwise I would have to translate the lat lon values myself and put the calculated value in the text file which will make performance to suffer…

  • 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-06T22:06:17+00:00Added an answer on June 6, 2026 at 10:06 pm

    Finally, I found the answer myself and I must say I`m very impressed! OpenLayers is quite powerful!
    Here is my solution:
    In the options of the map-object you have to set displayOptions to the projection of your layer, in my case it`s the following to support EPSG:4326:

    displayProjection: new OpenLayers.Projection("EPSG:4326")
    

    Then you only have to take care that the layer uses this projection (if it`s not the default value already). In my case, Text Layer didn`t work correctly on Android (in a WebView): I couldn`t open a popup when clicking on the image of a marker from the textfile. Instead, I`m using a Vector-Layer according to the sundials-Example:

    new OpenLayers.Layer.Vector("TextLayer", {
                projection: map.displayProjection,
                strategies: [new OpenLayers.Strategy.Fixed()],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "layerdata/chargingstationsmaptxtlayer.txt",
                    format: new OpenLayers.Format.Text({
                        extractStyles: true,
                        extractAttributes: true
                    })
                })
            });
    

    In the text-file I can now use the LatLon-values of the EPSG-4326 format. It`s so easy 😉

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

Sidebar

Related Questions

I'm currently implementing a histogram that will show a very large scale data using
I am working on an iPhone app in which I am implementing a map
I'm currently implementing a non-renewable in-app purchase and am a little concerned over the
I'm currently implementing a .NET wrapper for a Java library by using JNI to
I'm currently implementing a HTML canvas based webapp that features panning. Is there a
I am currently implementing S3 integration into my Rais application which uses Paperclip. Currently,
I'd like to make an app which would use custom map (instead of Google's
Im currently implementing an update feature into an app that I'm building. It uses
I have a MapView in which I am drawing buildings on using geopoints. Currently,
I am currently implementing a view in Android that involves using a larger than

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.