add extra layer in admin

49 views
Skip to first unread message

geosav

unread,
Dec 28, 2011, 5:59:30 PM12/28/11
to geodjango
I'm trying to add a geojson vector layer on top of the osm baselayer
while editing in admin.

I was given the following stub to use with this block statement within
the template openlayers.js( line 114)
{% block extra_layers %}{% endblock %}

{% extends "gis/admin/osm.js" %}
{% block extra_layers %}
// add layer info here
{% endblock %}

I created this file, myextra.js which is in the same folder as the
default geodjango templates.

needless to say, it does nothing. I'm obviously new to django and I
was hoping for a little direction

{% extends "gis/admin/osm.js" %}
{% block extra_layers %}
var brewster_boundary = new OpenLayers.Layer.Vector("Brewster Town
Lines", {
projection: new OpenLayers.Projection("EPSG:4326"),
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "/home/michael/PycharmProjects/bct/main/data/
zoning.geojson",
format: new OpenLayers.Format.GeoJSON({})
})
});
{% endblock %}


thanks in advance,

Michael


Reply all
Reply to author
Forward
0 new messages