Disappearing features when no basemap used

781
3
11-12-2016 12:19 PM
LukaszRutkowski1
New Contributor

I am trying to load a map without the standard ESRI basemap. I have an Arcgis server 10.3 service with 2 feature layers. In API 3.18 I simply created empty map and added those layers as FeatureLayers or as one ArcGISDynamiMapServiceLayer.

I have converted this code to 4.1 – added the MapView and again used either the FeatureLayer or this time the MapImageLayer.  In 3.18 the map shows fine, but in 4.1 I am getting a very strange behavior – only the features that overlap with the center of the map are showing – if I pan left or right some of them disappear and others show (again only those that “touch” imaginary vertical line going through the center of the map).

 

The layers are using UTM coordinate system. I tried setting the spatialReference on the MapVIew too but there is no difference. I have also experimented with extent of the Mapview.

I tried also creating my own Basemap with the same 2 layers and adding them to map – but again I observed the same behavior. Not sure if a basemap should be created from FeatureLayers (the documentation says basemap can be only created from tiled services) - nevertheless the map has shown.

(Checked different browsers too).

 

If I use any esri standard basemap (e.g. streets) and then add my layers everything works fine, so I assume it has something to do with the initial settings of the map object (or mapView) inheriting spatialReference, zoom level etc.. from my layers.

 

Another problem I noticed is that when I create an empty map and add it to mapView then panning or zooming throws javascript error (not sure this is intentional behavior, but I think it could be linked to the same problem).

 

Can anyone please post a working sample code of loading a simple map with the MapImageLayer and without any basemap.

 

Thanks in advance for any suggestions

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Lukasz,


  This is a known issue with 4.1 and projections other than 4326 and 102100. If you revert to 4.0 it should be fine.

LukaszRutkowski1
New Contributor

Robert,

Is there a place with the 4.0 documentation and the list of known issues (4.1 issues)? Can't find it.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lukasz,

  For older documentation you have to download it from this link (choose the version of JS API and then choose download documentation):

SDK Downloads | ArcGIS for Developers 

There probably is a bug # associated with it but I don't know what it is.

Here are some threads:

Graphics not displayed in JS API 4.1 with custom projection, works in 4.0 

custom basemap not working 4.1 api 

Bug in 4.1 while adding a Graphic to a MapView with Dutch Spatial Reference 

0 Kudos