smindel / silverstripe-gis

Adds support for geographic types.
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

default_location doesn't stick #6

Closed phptek closed 5 years ago

phptek commented 5 years ago

If I add a default_location in app.yml, that differs from the one declared in MapField, when I publish a Page object in the admin area, instead of replacing the MapField default, the yml-declared default is appended to it.

app.yml

Smindel\GIS\Forms\MapField:
  default_location:
    # Lon
    - '174.7'
    # Lat
    - '-41.2'

This doesn't look right, and as a result (I think) the map in the MapField no longer shows any information.

smindel commented 5 years ago

Good catch. I changed this value to be an associative array, no longer defined in the default_srid but lat/lng:

private static $default_location = [
    'lon' => 174.5,
    'lat' => -41.3
];

Please checkout 1.1.2