GeoRSS Layer

220
2
Jump to solution
11-15-2019 08:45 AM
ZairaRosas
New Contributor II

Hello everyone!!!

I am kind of new on JavaScript. I have been looking for a way to make an editable layer from GeoRSS feed. Because of the format, I can't change symbology or enable popup info from GeoRSS feed so I'm guessing that if I make a layer, I will be able to do it. I'm trying to do it by PictureMarkerSymbol and rendering but I don't know how to make the script work. I don't know if the symbology problem would be solved by rendering or making a layer or something like that and nor do I know if the situation with the popup could be solved by other java constructors ... Can a beautiful and kind soul help me, please?

This is my code:

<html>
<head>
  <meta name="description" content="DevLab: Style a feature layer">
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <title>ArcGIS JavaScript Tutorials: Style a feature layer</title>
  <style>
    html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  </style>
  <link rel="stylesheet" href="https://js.arcgis.com/4.13/esri/css/main.css">
  <script src="https://js.arcgis.com/4.13/"></script>
</head>
<script>
  require([
      "esri/Map",
      "esri/views/MapView",
      "esri/layers/GeoRSSLayer",
      "esri/symbols/PictureMarkerSymbol"
    ],
    function(
      Map,
      MapView,
      GeoRSSLayer,
      PictureMarkerSymbol
    ) {
      var map = new Map({
        basemap: "streets-night-vector"
      });

      var view = new MapView({
        container: "viewDiv",
        map: map,
        center: [-99.433823, 19.613484],
        zoom: 9
      });

      // Create the layer
      var WazeLayer = new GeoRSSLayer({
        url: "URL from GeoRSS sorry I can not provide it..."
     
});
      // Add the layer
      map.add(WazeLayer);
  });
  </script>
</head>

<body>
  <div id="viewDiv"></div>
</body>

</html>

Thank you so so so much

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

You need to set the GeoRSSLayer.pointSymbol to your PictureMarkerSymbol. I updated the GeoRSSLayer sample to show you how to do this. The following code snippet shows how it is done. But when you are using PictureMarkerSymbol you need to follow the CORs rule. 

var symbol = new PictureMarkerSymbol({
url: "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png",
width: "64px",
height: "64px"
});

var layer = new GeoRSSLayer({
url: "https://arcgis.github.io/arcgis-samples-javascript/sample-data/layers-georss/sample-georss.xml",
pointSymbol: symbol
});

Hope this helps,

-Undral

View solution in original post

2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

You need to set the GeoRSSLayer.pointSymbol to your PictureMarkerSymbol. I updated the GeoRSSLayer sample to show you how to do this. The following code snippet shows how it is done. But when you are using PictureMarkerSymbol you need to follow the CORs rule. 

var symbol = new PictureMarkerSymbol({
url: "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png",
width: "64px",
height: "64px"
});

var layer = new GeoRSSLayer({
url: "https://arcgis.github.io/arcgis-samples-javascript/sample-data/layers-georss/sample-georss.xml",
pointSymbol: symbol
});

Hope this helps,

-Undral

View solution in original post

ZairaRosas
New Contributor II

OMG, Thank you!

0 Kudos