maplibre_native 0.4.3

Rust bindings to the MapLibre Native map rendering engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "sources.h"
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/util/geometry.hpp>
#include <memory>

namespace mln::bridge::style::sources::geojson {
    std::unique_ptr<mbgl::style::GeoJSONSource> create(rust::Str id) {
        return std::make_unique<mbgl::style::GeoJSONSource>(std::string(id));
    }

    void setPoint(const std::unique_ptr<mbgl::style::GeoJSONSource>& source, double latitude, double longitude) {
        source->setGeoJSON(mbgl::Geometry<double>{mbgl::Point<double>{longitude, latitude}});
    }
}