Intellisense of CDN references in WebStorm
Hi,
I have installed WebStorm to try it and created an application. The application is simple here that I created in Webstorm.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css">
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3"></script>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js"></script>
<title>
Simple Project
</title>
<style>
html, body, #map {
height:100%;
width:100%;
margin:0;
padding:0;
}
#search {
display: block;
position: absolute;
z-index: 2;
top: 20px;
left: 74px;
}
</style>
<script>
dojo.require("esri.map");
dojo.require("esri.dijit.Geocoder");
var map, geocoder;
dojo.ready(function() {
// create the map
map = new esri.Map("map",{
basemap: "gray",
center: [-120.435, 46.159], // long, lat
zoom: 7
});
// create the geocoder
geocoder = new esri.dijit.Geocoder({
map: map
}, "search");
geocoder.startup();
});
</script>
</head>
<body>
<div id="search"></div>
<div id="map"></div>
</body>
</html>
1- WebStorm is warning about "Unresolved varible or type dojo". But I referenced google CDN dojo and arcgisonline api.
2- "map = new esri.Map" not getting intellisense about types or objects.
Can u help about these problems?
Please sign in to leave a comment.
Hello!
1. known issue, http://youtrack.jetbrains.com/issue/WEB-887
2. well, the standard dojo version doesn't include esri.Map. I was able to overcome this problem by creating the .js file from http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/ and using it as a dojo library in WebStorm
Best regards,
Lena