4 <title>geomap remove service test</title>
5 <link rel="stylesheet" type="text/css" href="css/style.css" />
6 <style type="text/css">
10 list-style-type: none;
15 <a href="../" class="docLink">< docs</a>
16 <h1>geomap remove service test</h1>
17 <p>Similar to the regular remove example but tests removing shapes from a specific service instead of the map itself.</p>
20 <div class="geomap" style="width: 640px; height: 480px;">
22 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
23 <script src="http://code.jquerygeo.com/jquery.geo-1.0a4.min.js"></script>
26 var geomap = $(".geomap").geomap({
27 center: [-71.05, 42.35],
30 service = geomap.find( ".osm" );
33 one: { type: "Point", coordinates: [-71.05, 42.35] },
34 two: { type: "Point", coordinates: [-71.045, 42.355] },
35 three: { type: "Point", coordinates: [-71.055, 42.345] },
36 four: { type: "Point", coordinates: [-71.055, 42.355] },
37 five: { type: "Point", coordinates: [-71.045, 42.345] }
42 for (var pointKey in points) {
43 service.geomap("append", points[pointKey]);
44 buttons += '<li><button type="button" data-point-key="' + pointKey + '">' + points[pointKey].coordinates + '</button></li>';
46 $("ul").append(buttons);
48 $("ul button").click(function () {
49 var pointKey = $(this).data("pointKey");
50 service.geomap("remove", points[pointKey]);