Navigation Menu

Skip to content

Commit

Permalink
display 'Powered by Esri' (#134)
Browse files Browse the repository at this point in the history
* display consistent Esri attribution

* bump dependencies
  • Loading branch information
jgravois committed Sep 14, 2016
1 parent 6905197 commit f442f22
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion debug/sample.html
Expand Up @@ -29,7 +29,10 @@

<script>
var map = L.map('map').setView([37.74, -121.62], 9);
var tiles = L.esri.basemapLayer('Topographic').addTo(map);
// var tiles = L.esri.basemapLayer('Topographic').addTo(map);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

var searchControl = L.esri.Geocoding.geosearch({
providers: [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -8,8 +8,8 @@
"John Gravois <jgravois@esri.com> (http://johngravois.com)"
],
"dependencies": {
"esri-leaflet": "^2.0.0",
"leaflet": "^1.0.0-rc.1"
"esri-leaflet": "^2.0.3",
"leaflet": "^1.0.0-rc.3"
},
"devDependencies": {
"chai": "2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion spec/Controls/GeosearchSpec.js
Expand Up @@ -68,7 +68,7 @@ describe('L.esri.Geosearch', function () {
]
}).addTo(map);

expect(map.attributionControl._container.innerHTML).to.contain('Geocoding by Esri');
expect(map.attributionControl._container.innerHTML).to.contain('Powered by');
});

it('should correctly build the searchExtent for the provider', function (done) {
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/Geosearch.js
@@ -1,5 +1,6 @@
import L from 'leaflet';
import { geosearchCore } from '../Classes/GeosearchCore';
import { Util } from 'esri-leaflet';

export var Geosearch = L.Control.extend({
includes: L.Mixin.Events,
Expand Down Expand Up @@ -165,6 +166,9 @@ export var Geosearch = L.Control.extend({
},

onAdd: function (map) {
// include 'Powered by Esri' in map attribution
Util.setEsriAttribution(map);

this._map = map;
this._wrapper = L.DomUtil.create('div', 'geocoder-control ' + ((this.options.expanded) ? ' ' + 'geocoder-control-expanded' : ''));
this._input = L.DomUtil.create('input', 'geocoder-control-input leaflet-bar', this._wrapper);
Expand Down
3 changes: 1 addition & 2 deletions src/Providers/ArcgisOnlineGeocoder.js
Expand Up @@ -3,8 +3,7 @@ import { GeocodeService } from '../Services/Geocode';
export var ArcgisOnlineProvider = GeocodeService.extend({
options: {
label: 'Places and Addresses',
maxResults: 5,
attribution: '<a href="https://developers.arcgis.com/en/features/geocoding/">Geocoding by Esri</a>'
maxResults: 5
},

suggestions: function (text, bounds, callback) {
Expand Down

0 comments on commit f442f22

Please sign in to comment.