ThinkGeo.com    |     Documentation    |     Premium Support

Lat/Lon lines on continuous scrolling map

Hi again,

I’ve changed the map unit to meters, and we are allowing continuous scrolling (keep scrolling in one direction to wrap around the globe.) We show lat/lon lines using the GraticuleAdornmentLayer and the LatLonNumAdornmentLayer code. These two layers are designed for a map unit of decimal degree, but I’ve reworked them to mostly work for meters. The problem is that neither the lat/lon lines, nor their labels, are drawing east of 180w or west of 180e.

To rework the code for a meters map unit, I convert the current extent upperLeft or lowerRight points to lat/lon using a ManagedProj4Projection. The problem is that projection’s .DecimalDegreeBoundry limits for longitude are -179.99 to 179.99. Thus, if my map extent if beyond those values, the .ConvertToExternalProjection function will cut them off to those limits.

Is there either
A) a way for the ConvertToExternalProjection function to return the true value of the current extent, and not be rounded to the DecimalDegreeBoundry limit

B) a way to reset the DecimalDegreeBoundry limits, or

C) GraticuleAdornmentLayer and LatLonNumAdornmentLayer versions that can handle this situation?

Thanks, let me know if you need any code of ours to review.

It looks like whenever ConvertToExternalProjection is called, the DecimalDegreeBoundary gets reset to it’s default values, and thus the conversion doesn’t do what we need it to do.

Also, here is the code creating this projection:

    proj4 = New ManagedProj4Projection
    proj4.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326)
    proj4.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString()

Hi Dib,

I think GraticuleAdornmentLayer won’t shows something like 200000º E, because that’s meaningless.

Our projection for GraticuleAdornmentLayer is convert the meter value into decimal degree value, so the label shows like 100º E. It will convert from external projection into internal projection.

If you want to make it beyond the limitation of 180, please try to set this value:
graticuleAdornmentLayer.WrappingMode = WrappingMode.WrapDateline;

Regards,

Don