Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

How to use our own basemap? #43

Closed
Kollibri opened this issue Apr 8, 2015 · 3 comments
Closed

How to use our own basemap? #43

Kollibri opened this issue Apr 8, 2015 · 3 comments
Labels

Comments

@Kollibri
Copy link
Contributor

Kollibri commented Apr 8, 2015

How would I modify this to use our own basemap? I have tried the following, but it results in an error:

"Uncaught TypeError: Cannot read property 'query' of null"

I have modified the esriMap directive as follows just to try forcing it to the new basemap:

Inside the controller, I have the following code:

require(['esri/map', 'esri/arcgis/utils', 'esri/basemaps'], function (Map, arcgisUtils, esriBasemaps) {
                    esriBasemaps.mcgiStreet = {
                        baseMapLayers: ['http://ourserverhere/arcgis/rest/services/BaseMap/StreetMap_tpt/MapServer'],
                        thumbnailUrl: 'http://servername.fqdn.suffix/images/thumbnail_2014-11-25_61051.png',
                        title: "Streetmap Transparent"
                    };

And then further down where the basemap is set, I have the following:

mapOptions.basemap = "mcgiStreet";

This is based off the example using the basemaps select box, and info from the following URL:
https://developers.arcgis.com/javascript/jsapi/esri.basemaps-amd.html

I'm relatively new to angular so I could be doing something wrong that is quite simple. Thank you for any help you can provide.

@tomwayson
Copy link
Member

I've never loaded a custom basemap in that way, but it looks valid based on the example in the JSAPI docs.

Are you working off of one of the test pages, or off of pages in the docs site? Right now there's a bug in the docs, see #38. If you're working there, try in one of the test pages - they are served by gulp at the site root level, so http://localhost:9002/simple-map.html

LMK if that was the issue.

If not, you might try using the exact "delorme" URLs from the example in the JSAPI docs.

@Kollibri
Copy link
Contributor Author

Kollibri commented Apr 8, 2015

Ah... I made a typo.....

The "baseMapLayers" option is an object with a property called "url". I didn't have that in right.

Sorry to have wasted your time.

Thank you for responding!

@Kollibri Kollibri closed this as completed Apr 8, 2015
@tomwayson
Copy link
Member

np - good to know this works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants