HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div id="mapDiv"></div>
#mapDiv {
height:100%;
width:100%;
position:absolute;
left:0;
top:0;
right:0;
bottom:0;
}
var cMap;
var mapCfg = '<mapView createdBy="name:cMapsAnalyticsDesigner;version:4.0" createdOn="12/10/2016"><viewName>My View</viewName><viewDescription></viewDescription><tags></tags><templateVersion></templateVersion><key>enter_your_own_key_d8d37yxn</key><googlePremierKey></googlePremierKey><sslEnabled>true</sslEnabled><baseMapTileUrl></baseMapTileUrl><baseMapTileCfg></baseMapTileCfg><useGoogleBase>true</useGoogleBase><useMapboxBase>false</useMapboxBase><useHereBase>false</useHereBase><useCartoBase>false</useCartoBase><useEsriBase>false</useEsriBase><dynamicZoomEnabled>true</dynamicZoomEnabled><currentLocationOnLoadDisabled>true</currentLocationOnLoadDisabled><panCoords></panCoords><zoomLevel></zoomLevel><dynamicZoomOnShapeSelect>false</dynamicZoomOnShapeSelect><dynamicZoomOnClusterSelect>false</dynamicZoomOnClusterSelect><dynamicZoomOnPointSelect>true</dynamicZoomOnPointSelect><showBreadcrumbsOnDrill>true</showBreadcrumbsOnDrill><dynamicZoomOnDrill>true</dynamicZoomOnDrill><multiSelectEnabled>false</multiSelectEnabled><adhocPanelVisibility>false</adhocPanelVisibility><radiusMeasureUnit>km</radiusMeasureUnit><indoorEnabled>true</indoorEnabled><useAdvancedInfowindow>true</useAdvancedInfowindow><showSearchBarWhenAIWHidden>true</showSearchBarWhenAIWHidden><showAIWOnLoad>true</showAIWOnLoad><showAIWOnLocSelect>true</showAIWOnLocSelect><includeAdvancedInfWinSummaryCard>false</includeAdvancedInfWinSummaryCard><includeAdvancedInfWinFilterCard>true</includeAdvancedInfWinFilterCard><includeAdvancedInfWinRankCard>false</includeAdvancedInfWinRankCard><includeAdvancedInfWinTimeCard>true</includeAdvancedInfWinTimeCard><includeAdvancedInfWinSearchCard>true</includeAdvancedInfWinSearchCard><includeAdvancedInfWinSearchPlacesCard>false</includeAdvancedInfWinSearchPlacesCard><includeAdvancedInfWinExportCard>false</includeAdvancedInfWinExportCard><includeAdvancedInfWinDriveCard>false</includeAdvancedInfWinDriveCard><includeAdvancedInfWinDrivePolysCard>false</includeAdvancedInfWinDrivePolysCard><includeAdvancedInfWinDrillCard>false</includeAdvancedInfWinDrillCard><includeAdvancedInfWinSelectCard>false</includeAdvancedInfWinSelectCard><includeAdvancedInfWinStreetViewCard>false</includeAdvancedInfWinStreetViewCard><includeAdvancedInfWinCustomCard>false</includeAdvancedInfWinCustomCard><advancedInfoWindowJsonCfg></advancedInfoWindowJsonCfg><infoWindowFontFamily>Arial</infoWindowFontFamily><infoWindowFontSize>12</infoWindowFontSize><infoWindowFontColor>000000</infoWindowFontColor><infoWindowFontAlign>left</infoWindowFontAlign><infoWindowUseBoldFont>false</infoWindowUseBoldFont><infoWindowFontUnderlineEnabled>false</infoWindowFontUnderlineEnabled><infWinItalicFontEnabled>false</infWinItalicFontEnabled><infoWindowVisibility>true</infoWindowVisibility><infoWindowValueVisibility>true</infoWindowValueVisibility><infoWindowLayerNameVisibility>true</infoWindowLayerNameVisibility><glowVisibility>true</glowVisibility><glowColor>0000ff</glowColor><baseMapImageryStyleType>styleTypeRoadmap</baseMapImageryStyleType><enablePoiInteractivity>true</enablePoiInteractivity><showTrafficLayer>false</showTrafficLayer><showTransitLayer>false</showTransitLayer><showBikelayer>false</showBikelayer><legendVisibility>false</legendVisibility><clusterToggleControlVisibility>false</clusterToggleControlVisibility><navigationControlVisibility>true</navigationControlVisibility><currentLocationControlVisibility>false</currentLocationControlVisibility><mapReady>true</mapReady><layerSelected>false</layerSelected><zoomChanged>false</zoomChanged><centerChanged>false</centerChanged><reverseGeocodeResponse>false</reverseGeocodeResponse><latLngToReverseGeocode></latLngToReverseGeocode><geocodeResponse>false</geocodeResponse><addressToGeocode></addressToGeocode><visible>true</visible><indoorMapVisibility>false</indoorMapVisibility><showPinsForIndoorMapLocations>false</showPinsForIndoorMapLocations><directionPanelVisibility>false</directionPanelVisibility><directionWaypoints></directionWaypoints><currentLocation>false</currentLocation><useFreeApi>false</useFreeApi><layers><layer><name>My Layer</name><description></description><type>points</type><sankeyJsonData></sankeyJsonData><cartoDBJsonVizURL></cartoDBJsonVizURL><cartoDBSubLayerId>null</cartoDBSubLayerId><cartoDBUser></cartoDBUser><cartoDBSqlQuery></cartoDBSqlQuery><cartoDBMeasFieldName>null</cartoDBMeasFieldName><cartoDBDrillColName>null</cartoDBDrillColName><cartoDBTorqueJsonVizURL></cartoDBTorqueJsonVizURL><cartoDBUsername></cartoDBUsername><cartoDBMapName></cartoDBMapName><cartoDBAuthKey></cartoDBAuthKey><cartoDBMapLayerName></cartoDBMapLayerName><cartoDBMapLayerInteractivity></cartoDBMapLayerInteractivity><cartoDBMapLayerTorqueCSS></cartoDBMapLayerTorqueCSS><useLayerSpecificApiInfWins>true</useLayerSpecificApiInfWins><useLayerSpecificApiTooltips>true</useLayerSpecificApiTooltips><cartoDBMapLayerUseHttps>true</cartoDBMapLayerUseHttps><indoorMapUrl></indoorMapUrl><bufferDependentLayer>none</bufferDependentLayer><bufferDistUnit>meters</bufferDistUnit><bufferPlacement>back</bufferPlacement><shapeFileType>customUrl</shapeFileType><shapeFileUrl></shapeFileUrl><shapeGeocoderLevel>uszips</shapeGeocoderLevel><dataKeysUrl></dataKeysUrl><dataSourceType>statictsv</dataSourceType><dataSource><![CDATA[37.7693911,-122.4290072 Dr. Goldstein 50 8/9/2016\r\n \
37.790998,-122.431254 Dr. Pinenuts 11 11/13/2016\r\n \
37.7480245,-122.4208806 Dr. Smith 12 8/2/2016\r\n \
37.789675,-122.417049 Dr. Jones 14 7/23/2016\r\n \
37.7565985,-122.4045723 Dr. Roger 15 2/19/2016\r\n \
37.7956765,-122.4092976 Dr. Rasheed 16 2/2/2016\r\n \
37.7630855,-122.4578733 Dr. Dongle 17 7/5/2016\r\n \
37.7739893,-122.4544912 Dr. Douglus 18 10/25/2016\r\n \
37.7473074,-122.4592076 Dr. Favre 19 6/18/2016\r\n \
37.780416,-122.403231 Dr. Oliver 10 4/4/2016\r\n \
37.779602,-122.402201 Dr. Alexander 12 6/8/2016\r\n \
37.778856,-122.402201 Dr. Mueller 5 12/6/2016\r\n \
37.778042,-122.402458 Dr. Buckley 11 1/16/2016\r\n \
37.777567,-122.404518 Dr. Koch 7 11/19/2016\r\n \
37.778585,-122.404776 Dr. Gallagher 19 11/24/2016\r\n \
37.779806,-122.40469 Dr. Mckinney 2 7/14/2016\r\n \
37.781027,-122.405291 Dr. Lucero 19 3/22/2016\r\n \
37.779399,-122.406921 Dr. Henderson 5 5/15/2016\r\n \
37.777024,-122.406149 Dr. Brennan 7 10/10/2016\r\n \
37.777296,-122.40881 Dr. Perez 3 8/1/2016\r\n \
37.77967,-122.408209 Dr. Harvey 7 2/25/2016\r\n \
37.775803,-122.412329 Dr. Sutton 2 3/21/2016\r\n \
37.779941,-122.428637 Dr. Shea 12 3/18/2016\r\n \
37.779059,-122.429066 Dr. Preston 6 6/11/2016\r\n \
37.777228,-122.425289 Dr. Rich 12 5/22/2016\r\n \
37.777228,-122.419796 Dr. Delgado 10 6/2/2016\r\n \
37.780959,-122.418165 Dr. Dalton 12 8/24/2016\r\n \
37.780348,-122.416706 Dr. Villanueva 20 12/19/2016\r\n \
37.782926,-122.414217 Dr. Merritt 19 11/24/2016\r\n \
37.784893,-122.41353 Dr. Galloway 2 11/18/2016\r\n \
37.787742,-122.424946 Dr. Russell 5 8/31/2016\r\n \
37.789438,-122.417908 Dr. Holmes 12 6/21/2016\r\n \
37.788488,-122.411299 Dr. Daniel 19 3/14/2016\r\n \
37.79249,-122.40941 Dr. Donovan 11 8/19/2016]]></dataSource><esriMapServerURL></esriMapServerURL><dataSourceColumnDefs>[{"dataField":"dsLocationColumn","fieldDisplayName":"","colPosition":0},{"dataField":"dsLabelColumn","fieldDisplayName":"","colPosition":1},{"dataField":"dsValueColumn","fieldDisplayName":"","colPosition":2},{"dataField":"dsTimeColumn","fieldDisplayName":"","colPosition":3},{"dataField":"dsCategoryColumn","fieldDisplayName":"","colPosition":4},{"dataField":"dsDrillIdColumn","fieldDisplayName":"","colPosition":5},{"dataField":"dsTimeColumn","fieldDisplayName":"","colPosition":6}]</dataSourceColumnDefs><transparency>100</transparency><enabled>true</enabled><iconSize>20</iconSize><iconType>pin</iconType><clusterStyle>disabled</clusterStyle><dynamicSizeEnabled>false</dynamicSizeEnabled><useLogScale>false</useLogScale><visibility>true</visibility><minZoomVis>1</minZoomVis><maxZoomVis>23</maxZoomVis><drillLevel></drillLevel><drillEventTrigger>none</drillEventTrigger><drillParent>none</drillParent><drillVisibilityOverride>false</drillVisibilityOverride><useCurrentLocationAsStartPoint>false</useCurrentLocationAsStartPoint><travelMode>Driving</travelMode><travelUnits>IMPERIAL</travelUnits><markerLayerBindings></markerLayerBindings><useCacheDriveTimePolyService>on</useCacheDriveTimePolyService><wmsURL></wmsURL><wmsStyleString></wmsStyleString><wmsLayerString></wmsLayerString><layerColor>1b8dce</layerColor><alerts><alertIcons>pin,pin</alertIcons><alertType>type-none</alertType><alertValues>50,100</alertValues><numAlertLevels>2</numAlertLevels><alertHeatmapVals>50,100</alertHeatmapVals><alertDefinition>high-values-good</alertDefinition><alertColors>c0c0c0,008800</alertColors></alerts></layer></layers></mapView>';
function buildMap(){
cMap = new centigon.locationIntelligence.MapView();
cMap.parseConfigXml(mapCfg);
};
//WHEN DOCUMENT LOADED INITIALIZE THE MAP
$(document).ready(function(){
// CALL THE FUNCTION
buildMap();
});
Also see: Tab Triggers