Skip to content

Commit

Permalink
Fixed draw rectangle for mobile (Patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofsumit committed Jul 5, 2018
1 parent e035406 commit ca8d967
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1,450 deletions.
22 changes: 22 additions & 0 deletions cypress/integration/rectangle.spec.js
@@ -0,0 +1,22 @@
describe('Draw Rectangle', () => {
const mapSelector = '#map';

it('places markers', () => {
cy.toolbarButton('rectangle')
.click()
.parent('a')
.should('have.class', 'active');

cy.get(mapSelector)
.click(200, 200)
.click(400, 350);

cy.toolbarButton('edit')
.click()
.parent('a')
.should('have.class', 'active');

cy.hasVertexMarkers(4);
cy.hasMiddleMarkers(0);
});
});
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Leaflet Geometry Management</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@latest/dist/leaflet.css" />
<link rel="stylesheet" href="../dist/leaflet.pm.css">
<link rel="stylesheet" href="dist/leaflet.pm.css">
<script src="https://unpkg.com/leaflet@latest/dist/leaflet.js"></script>
<!-- <script src="../../leaflet-measure-path/leaflet-measure-path.js"></script> -->
<!-- <script src="https://unpkg.com/leaflet.markercluster@1.0.0"></script> -->
Expand Down Expand Up @@ -37,7 +37,7 @@
<div class="wrapper">
<div id="map"></div>
</div>
<script src="../dist/leaflet.pm.min.js"></script>
<script src="dist/leaflet.pm.min.js"></script>
</body>

</html>

0 comments on commit ca8d967

Please sign in to comment.