1
1
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- var L, SimpleExample, react;
2
+ var L, SimpleExample, em, p, react, strong, _ref ;
3
3
4
4
react = require("react");
5
5
6
6
L = require("../src");
7
7
8
+ _ref = react.DOM, p = _ref.p, strong = _ref.strong, em = _ref.em;
9
+
8
10
SimpleExample = react.createClass({
9
11
displayName: "SimpleExample",
10
12
render: function() {
@@ -14,17 +16,17 @@ SimpleExample = react.createClass({
14
16
}, L.TileLayer({
15
17
url: "http://{s}.tile.osm.org/{z}/{x}/{y}.png",
16
18
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
17
- }) , L.Marker({
19
+ }, L.Marker({
18
20
position: [51.505, -0.09]
19
- }));
21
+ }, L.Popup(null, p(null, strong(null, "Hello"), em(null, " World")))) ));
20
22
}
21
23
});
22
24
23
25
react.renderComponent(SimpleExample(), document.getElementById("content"));
24
26
25
27
26
28
27
- },{"../src":168 ,"react":164}],2:[function(require,module,exports){
29
+ },{"../src":169 ,"react":164}],2:[function(require,module,exports){
28
30
// shim for using process in browser
29
31
30
32
var process = module.exports = {};
@@ -29737,8 +29739,8 @@ module.exports = Map;
29737
29739
29738
29740
29739
29741
29740
- },{"./types/latlng":169 ,"./types/latlngBounds":170 ,"leaflet":3,"lodash-node/modern/utilities/uniqueId":4,"react/addons":5}],166:[function(require,module,exports){
29741
- var Type, latlngType, leaflet, react;
29742
+ },{"./types/latlng":170 ,"./types/latlngBounds":171 ,"leaflet":3,"lodash-node/modern/utilities/uniqueId":4,"react/addons":5}],166:[function(require,module,exports){
29743
+ var Type, latlngType, leaflet, noscript, react;
29742
29744
29743
29745
react = require("react");
29744
29746
@@ -29748,6 +29750,8 @@ Type = react.PropTypes;
29748
29750
29749
29751
latlngType = require("./types/latlng");
29750
29752
29753
+ noscript = react.DOM.noscript;
29754
+
29751
29755
module.exports = react.createClass({
29752
29756
displayName: "Marker",
29753
29757
propTypes: {
@@ -29762,42 +29766,95 @@ module.exports = react.createClass({
29762
29766
if (this.props.map) {
29763
29767
this.state.marker.addTo(this.props.map);
29764
29768
}
29769
+ return noscript(null, react.Children.map(this.props.children, (function(_this) {
29770
+ return function(child) {
29771
+ return react.addons.cloneWithProps(child, {
29772
+ map: _this.props.map,
29773
+ layer: _this.props.layer,
29774
+ marker: _this.state.marker
29775
+ });
29776
+ };
29777
+ })(this)));
29778
+ }
29779
+ });
29780
+
29781
+
29782
+
29783
+ },{"./types/latlng":170,"leaflet":3,"react":164}],167:[function(require,module,exports){
29784
+ var leaflet, react;
29785
+
29786
+ react = require("react");
29787
+
29788
+ leaflet = require("leaflet");
29789
+
29790
+ module.exports = react.createClass({
29791
+ displayName: "Popup",
29792
+ getInitialState: function() {
29793
+ return {
29794
+ popup: leaflet.popup(this.props, this.props.layer)
29795
+ };
29796
+ },
29797
+ render: function() {
29798
+ var content;
29799
+ if (this.props.children) {
29800
+ content = react.renderComponentToString(this.props.children);
29801
+ if (this.props.marker) {
29802
+ this.props.marker.bindPopup(content);
29803
+ } else {
29804
+ this.state.popup.setContent(content);
29805
+ if (this.props.position) {
29806
+ this.state.popup.setLatLng(this.props.position);
29807
+ }
29808
+ if (this.props.map) {
29809
+ this.state.popup.openOn(this.props.map);
29810
+ }
29811
+ }
29812
+ }
29765
29813
return null;
29766
29814
}
29767
29815
});
29768
29816
29769
29817
29770
29818
29771
- },{"./types/latlng":169," leaflet":3,"react":164}],167 :[function(require,module,exports){
29772
- var Type, leaflet, react;
29819
+ },{"leaflet":3,"react":164}],168 :[function(require,module,exports){
29820
+ var Type, leaflet, noscript, react;
29773
29821
29774
29822
react = require("react");
29775
29823
29776
29824
leaflet = require("leaflet");
29777
29825
29778
29826
Type = react.PropTypes;
29779
29827
29828
+ noscript = react.DOM.noscript;
29829
+
29780
29830
module.exports = react.createClass({
29781
29831
displayName: "TileLayer",
29782
29832
propTypes: {
29783
29833
url: Type.string.isRequired
29784
29834
},
29785
29835
getInitialState: function() {
29786
29836
return {
29787
- tile : leaflet.tileLayer(this.props.url, this.props)
29837
+ tileLayer : leaflet.tileLayer(this.props.url, this.props)
29788
29838
};
29789
29839
},
29790
29840
render: function() {
29791
29841
if (this.props.map) {
29792
- this.state.tile .addTo(this.props.map);
29842
+ this.state.tileLayer .addTo(this.props.map);
29793
29843
}
29794
- return null;
29844
+ return noscript(null, react.Children.map(this.props.children, (function(_this) {
29845
+ return function(child) {
29846
+ return react.addons.cloneWithProps(child, {
29847
+ map: _this.props.map,
29848
+ layer: _this.state.tileLayer
29849
+ });
29850
+ };
29851
+ })(this)));
29795
29852
}
29796
29853
});
29797
29854
29798
29855
29799
29856
29800
- },{"leaflet":3,"react":164}],168 :[function(require,module,exports){
29857
+ },{"leaflet":3,"react":164}],169 :[function(require,module,exports){
29801
29858
var leaflet, setIconDefaultImagePath;
29802
29859
29803
29860
leaflet = require("leaflet");
@@ -29812,12 +29869,13 @@ module.exports = {
29812
29869
setIconDefaultImagePath: setIconDefaultImagePath,
29813
29870
Marker: require("./Marker"),
29814
29871
Map: require("./Map"),
29872
+ Popup: require("./Popup"),
29815
29873
TileLayer: require("./TileLayer")
29816
29874
};
29817
29875
29818
29876
29819
29877
29820
- },{"./Map":165,"./Marker":166,"./TileLayer ":167,"leaflet":3}],169 :[function(require,module,exports){
29878
+ },{"./Map":165,"./Marker":166,"./Popup ":167,"./TileLayer":168," leaflet":3}],170 :[function(require,module,exports){
29821
29879
var Type, react;
29822
29880
29823
29881
react = require("react");
@@ -29836,7 +29894,7 @@ module.exports = Type.oneOfType([
29836
29894
29837
29895
29838
29896
29839
- },{"react":164}],170 :[function(require,module,exports){
29897
+ },{"react":164}],171 :[function(require,module,exports){
29840
29898
var Type, latlng, react;
29841
29899
29842
29900
react = require("react");
@@ -29849,4 +29907,4 @@ module.exports = Type.arrayOf(latlng);
29849
29907
29850
29908
29851
29909
29852
- },{"./latlng":169 ,"react":164}]},{},[1]);
29910
+ },{"./latlng":170 ,"react":164}]},{},[1]);
0 commit comments