Select to view content in your preferred language

Problems with center and marker URL parameters

3768
8
Jump to solution
02-17-2016 03:14 AM
MattiasEkström
Regular Contributor

The center and marker URL parameters doesn't work for me with the embedded map viewer.

The map doesn't center where it's supposed to, it seems to be centering in the middle of my web map regardless of the coordinates I'm using.
I tried to create a web app with web app builder and with that app the URL-parameters works so that's my work around for now, but why doesn't it work with the embedded viewer?

This works:

http://oskarshamn.maps.arcgis.com/apps/webappviewer/index.html?id=7612462e981a457794bd936d4e9549ad&m...

This doesn't:

http://oskarshamn.maps.arcgis.com/apps/Embed/index.html?webmap=0fe9b350b5444a07bca12b1666ae8c42&mark...

with marker you don't have to use center, but I've tried adding &center=147290,6349306,3010 as well but it's the same. I've also tried using non projected coordinates but it's also the same.

EDIT: Forgot to mention that the marker is placed correctly in both cases, but the centering doesn't work with the embedded viewer.

I could just settle with my web app, but it's a little bit slower and with the embedded viewer there's no popup for the marker if I just pass the coordinates, and that's what I want in this case. The web App shows an empty PopUp, anyone knows how to disable the popup for an URL parameter marker using Web AppBuilder for ArcGIS​??

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

It will work at the next release for the embed app but does not work with the current release.

View solution in original post

8 Replies
RobertScheitlin__GISP
MVP Emeritus

Mattias,

  Sure you can disable the popup for the center url marker when using WAB Dev.

Open the MapUrlParamsHandler.js and find the addMarker function (line 7 change infoTemplate to null as below):

function addMarker(point, markerSymbol, textSymbol, title, map){
    var markerG, textG;
    var infoTemplate = new InfoTemplate('', title);
    var layer = new GraphicsLayer();
    map.addLayer(layer);

    markerG = new Graphic(point, markerSymbol, null, null);
    layer.add(markerG);
    if (textSymbol) {
      textSymbol.xoffset = markerSymbol.width / 2;
      textSymbol.yoffset = markerSymbol.height / 2 + markerSymbol.yoffset;
      textG = new Graphic(new Point(point.toJson()), textSymbol);
      layer.add(textG);
    }

    map.centerAt(point);
  }
0 Kudos
MattiasEkström
Regular Contributor

Thanks Robert, but we're not using the Dev version.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mattias,

   Then you have no option to remove the popup for the marker then.

RebeccaStrauch__GISP
MVP Emeritus

From what I can read Use URL parameters to modify maps—ArcGIS Online Help | ArcGIS   it looks like you are doing it correctly, but it is almost as if you have an extent that is overriding it.  I was able o at least see you marker if I set the level=2 instead of 7.......removing the &level=# completely at least allowed it to center.  So I would see if that would work for you to start.

KellyHutchins
Esri Frequent Contributor

At the current release the embed app doesn't support specifying coordinates in values other than lat/lon. At the next release due out later this month this is supported and your example url will work as it does in the Web App Builder.

MattiasEkström
Regular Contributor

I've tried with lat/long values as well but it doesn't work for the embed app either, or am I missing something in these URLs?

Web app, centers correctly:

http://oskarshamn.maps.arcgis.com/apps/webappviewer/index.html?id=7612462e981a457794bd936d4e9549ad&m...

embed app, doesn't center correctly:

http://oskarshamn.maps.arcgis.com/apps/Embed/index.html?webmap=0fe9b350b5444a07bca12b1666ae8c42&mark...

I didn't know there was a different between modifying a webmap and the embed app, but I saw that in the documentation now. But still the above should work right? This URL for the webmap viewer works as well
http://www.arcgis.com/home/webmap/viewer.html?webmap=0fe9b350b5444a07bca12b1666ae8c42&marker=16.4551...

0 Kudos
KellyHutchins
Esri Frequent Contributor

It will work at the next release for the embed app but does not work with the current release.

KellyHutchins
Esri Frequent Contributor

Mattias Ekström​ the release last night should have resolved the url param issues you were experiencing.  I tested your links above and it looks good to me. Please let me know if you see any issues.

http://oskarshamn.maps.arcgis.com/apps/Embed/index.html?webmap=0fe9b350b5444a07bca12b1666ae8c42&mark...