Skip to content

Commit

Permalink
Merge pull request #748 from OpenGeoscience/default-annotation-geojso…
Browse files Browse the repository at this point in the history
…n-gcs

Fix handling gcs in geojson annotation imports.
  • Loading branch information
manthey authored Nov 16, 2017
2 parents 6c5c2e6 + b94dd14 commit 62de84f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/annotationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ var annotationLayer = function (args) {
*/
this._geojsonFeatureToAnnotation = function (feature, gcs) {
var dataList = feature.data(),
annotationList = registry.listAnnotations();
annotationList = registry.listAnnotations(),
map = m_this.map();
gcs = (gcs === null ? map.gcs() : (
gcs === undefined ? map.ingcs() : gcs));
$.each(dataList, function (data_idx, data) {
var type = (data.properties || {}).annotationType || feature.featureType,
options = $.extend({}, data.properties || {}),
Expand Down Expand Up @@ -536,8 +539,8 @@ var annotationLayer = function (args) {
datagcs = ((data.crs && data.crs.type === 'name' && data.crs.properties &&
data.crs.properties.type === 'proj4' &&
data.crs.properties.name) ? data.crs.properties.name : gcs);
if (datagcs !== m_this.map().gcs()) {
position = transform.transformCoordinates(datagcs, m_this.map().gcs(), position);
if (datagcs !== map.gcs()) {
position = transform.transformCoordinates(datagcs, map.gcs(), position);
}
options.coordinates = position;
/* For each style listed in the geojsonStyleProperties object, check if
Expand Down

0 comments on commit 62de84f

Please sign in to comment.