I am using Openlayers API and I have a custom projection and I defined it to my geoserver named "EPSG:51100".

I have a custom tile map.

        var tms2013 = new OpenLayers.Layer.TMS("2013", "http://mydomin/uydu/2013/", {
                type: 'png', 
                getURL: get_my_url, 
                isBaseLayer: true,
                tileOrigin: tileOrigin,
                serverResolutions: [.......]

I have generated a geolocation service to zoom on map.

        var geolocation = new OpenLayers.Control.Geolocate({
                enableHighAccuracy: false,
                maximumAge: 0,
                timeout: 7000
        geolocation.events.register("locationupdated", geolocation, onLocationUpdated);

        function onLocationUpdated(e){
            var inProjection =  new OpenLayers.Projection("EPSG:4326");
            var outProjection = map.getProjectionObject();
            var position = new OpenLayers.LonLat(
                 e.position.coords.longitude, e.position.coords.latitude);
            position.transform(inProjection, outProjection);

            map.setCenter(position, 9);

I want to transform the incoming coordinate from geolocate object to my coordinate system but not working.

incoming coordinages like this: lat: 60.763678 lon: 59.896539799999996

after transofrom process : lat: 60.763678 lon: 59.8965398

But it should be like this. lat: 60763.6780 lon: 5989653.9870

I mean the transformation is not working.

  • how are you sending the coordinates to GeoServer? – Ian Turton Aug 18 '14 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.