Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test and documentation #33

Closed
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ docs/_build/
docs/source/_static/
docs/source/_static/embed-bundle.js
docs/source/_static/embed-bundle.js.map
docs/build
docs/content
docs/.jupyterlite.doit.db
docs/jupyterlite_config.json


# PyBuilder
target/
Expand Down Expand Up @@ -164,3 +169,7 @@ ipyopenlayers/nbextension


.yarn

#jupyter lite
_output
.jupyterlite.doit.db
1 change: 1 addition & 0 deletions docs/europe_110.geo.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/source/api_reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
API Reference
=============

.. automodule:: ipyopenlayers.openlayers
:members:
:no-index:
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)}

# Read The Docs
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
Expand Down
40 changes: 40 additions & 0 deletions docs/source/controls/fullscreen_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Fullscreen Control
==================


The Fullscreen Control in `ipyopenlayers` allows users to toggle the map view between fullscreen and windowed modes. This control enhances the user experience by providing an easy way to expand the map to occupy the entire screen.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, FullScreen


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)


# Add a FullscreenControl to the map
fullscreen_control = FullScreen()
m.add_control(fullscreen_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.FullScreen
:members:


11 changes: 11 additions & 0 deletions docs/source/controls/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Controls
===================
Controls provide interactive elements on a map that allow users to manipulate the map view or access additional functionalities. These controls can include zoom buttons, layer switches, and other user interface elements that enhance the usability and functionality of the map.

.. toctree::
:maxdepth: 1

zoomslider_control
scaleline_control
fullscreen_control
mouseposition_control
38 changes: 38 additions & 0 deletions docs/source/controls/mouseposition_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Mouse Position Control
======================


The Mouse Position Control in `ipyopenlayers` shows the geographical coordinates of the mouse pointer on the map. This control is useful for users who need to know the precise location of their cursor within the map view.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, MousePosition


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)


# Add a MousePositionControl to the map
mouseposition_control = MousePosition()
m.add_control(mouseposition_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.MousePosition
:members:
38 changes: 38 additions & 0 deletions docs/source/controls/scaleline_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Scaleline Control
=================


The Scaleline Control in `ipyopenlayers` displays a scale line on the map, providing users with a visual reference for the map's scale. This helps users to understand the distances represented on the map at the current zoom level.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, ScaleLine


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)


# Add a ScalelineControl to the map
scaleline_control = ScaleLine()
m.add_control(scaleline_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.ScaleLine
:members:
39 changes: 39 additions & 0 deletions docs/source/controls/zoomslider_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Zoom Slider Control
===================


The Zoom Slider Control in `ipyopenlayers` provides a convenient slider interface for users to control the zoom level of the map.
This control enhances the user experience by allowing a more intuitive and precise adjustment of the zoom level.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, ZoomSlider


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)


# Add a ZoomSlider control to the map
zoom_slider = ZoomSlider()
m.add_control(zoom_slider)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.ZoomSlider
:members:
18 changes: 0 additions & 18 deletions docs/source/examples/index.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/source/examples/introduction.nblink

This file was deleted.

41 changes: 27 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@

ipyopenlayers
=====================================

Version: |release|

OpenLayers Jupyter Widget


Quickstart
----------

To get started with ipyopenlayers, install with pip::

pip install ipyopenlayers

or with conda::

conda install ipyopenlayers

pip install ipyopenlayers

Contents
--------
Expand All @@ -26,24 +19,44 @@ Contents
:maxdepth: 2
:caption: Installation and usage

installing
introduction
installing
develop-install

.. toctree::
:maxdepth: 2
:caption: Map

map/index

.. toctree::
:maxdepth: 1
:maxdepth: 2
:caption: Layers and Overlays

examples/index
layers/index
overlay/index

.. toctree::
:maxdepth: 2
:caption: Controls

controls/index

.. toctree::
:maxdepth: 2
:caption: Development
:caption: API

api_reference/index

develop-install

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. links

.. _`Jupyter widgets`: https://jupyter.org/widgets.html

.. _`notebook`: https://jupyter-notebook.readthedocs.io/en/latest/
22 changes: 10 additions & 12 deletions docs/source/installing.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@

.. _installation:

Installation
============

Installing using pip
----------------------------------

The simplest way to install ipyopenlayers is via pip::

pip install ipyopenlayers

or via conda::

conda install ipyopenlayers

Installing the Front-end Extension
----------------------------------

If you installed via pip, and notebook version < 5.3, you will also have to
install / configure the front-end extension as well. If you are using classic
notebook (as opposed to Jupyterlab), run::

jupyter nbextension install [--sys-prefix / --user / --system] --py ipyopenlayers

jupyter nbextension enable [--sys-prefix / --user / --system] --py ipyopenlayers

with the `appropriate flag`_. If you are using Jupyterlab, install the extension
with::
with the `appropriate flag`_.

jupyter labextension install ipyopenlayers
Installing for JupyterLab
-------------------------

If you are using JupyterLab, install the extension with::

If you are installing using conda, these commands should be unnecessary, but If
you need to run them the commands should be the same (just make sure you choose the
`--sys-prefix` flag).
jupyter labextension install ipyopenlayers


.. links
Expand Down
22 changes: 17 additions & 5 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
=============
Introduction
=============
=============================
Introduction to ipyopenlayers
=============================

.. todo::
ipyopenlayers is a Jupyter widget for OpenLayers, a robust open-source JavaScript library for interactive mapping. This integration significantly enhances the capability to visualize GIS data, particularly enabling dynamic and real-time analysis of spatial information. By bringing OpenLayers' advanced mapping features into the Jupyter environment, ipyopenlayers empowers engineers, scientists, and analysts to perform spatial data exploration and analysis more efficiently and effectively.

Every object in ipyopenlayers (including the Map, TileLayers, Layers, Controls, etc.) is interactive, allowing users to dynamically update attributes from Python or directly from the browser. This interactivity makes ipyopenlayers a powerful tool for creating sophisticated and responsive GIS applications within Jupyter notebooks.


Try it online
-------------

You can try ipyopenlayers below, or open many other live examples in a new browser tab with : JupyterLite.

- `JupyterLite <http://127.0.0.1:8000/lab/index.html>`_

.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
:target: http://127.0.0.1:8000/lab/index.html

add prose explaining project purpose and usage here
Loading
Loading