Hi john marker,
It sounds like there is some confusion about some C++ concepts. The Runtime SDK headers provide the declaration of the classes, but as the consumer of these objects, it is your responsibility to make sure they are initialized properly.
>I assumed m_polylineBuilder was a default member variable within the class
Which class? I assume that is a class you are working with and not one of the classes/files that are included with the Runtime SDK.
Here's an example of creating a PolylineBuilder object.
Header file:
namespace Esri
{
namespace ArcGISRuntime
{
class Map;
class MapQuickView;
class PolylineBuilder;
}
}
#include <QObject>
class Untitled107 : public QObject
{
Q_OBJECT
Q_PROPERTY(Esri::ArcGISRuntime::MapQuickView* mapView READ mapView WRITE setMapView NOTIFY mapViewChanged)
public:
explicit Untitled107(QObject* parent = nullptr);
~Untitled107() override;
signals:
void mapViewChanged();
private:
Esri::ArcGISRuntime::MapQuickView* mapView() const;
void setMapView(Esri::ArcGISRuntime::MapQuickView* mapView);
Esri::ArcGISRuntime::PolylineBuilder* m_polyBuilder = nullptr;
Esri::ArcGISRuntime::Map* m_map = nullptr;
Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr;
};
And then in the .cpp file, you can include the header and initialize the object
#include "Untitled107.h"
#include "Basemap.h"
#include "Map.h"
#include "MapQuickView.h"
#include "PolylineBuilder.h"
#include <QUrl>
using namespace Esri::ArcGISRuntime;
Untitled107::Untitled107(QObject* parent ):
QObject(parent),
m_polyBuilder(new PolylineBuilder(SpatialReference::wgs84(), this)),
m_map(new Map(Basemap::topographic(this), this))
{
}
Untitled107::~Untitled107()
{
}
This is an example of adding a PolylineBuilder to one of our template projects.