Last active
October 18, 2018 02:36
-
-
Save steelydylan/d288514741dbd6303b17a42f2d8f22f5 to your computer and use it in GitHub Desktop.
a-blog cms のカスタムフィールドでyahooMapを利用する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="formColumnMap js-yahoo-map"> | |
<tr> | |
<td class="formColumnMapTd"> | |
<!-- BEGIN_IF [%{PROTOCOL}/eq/https] --> | |
<img class="column-map js-map_editable-container" src="//map.yahooapis.jp/map/V1/static?appid=%{YAHOO_API_KEY}&lat={mapLat}&lon={mapLng}&z={mapZoom}&width=400&height=400&pointer=on" | |
width="400" height="400"> | |
<!-- ELSE --> | |
<img class="column-map js-map_editable-container" src="//map.olp.yahooapis.jp/OpenLocalPlatform/V1/static?appid=%{YAHOO_API_KEY}&lat={mapLat}&lon={mapLng}&z={mapZoom}&width=400&height=400&pointer=on" | |
width="400" height="400"> | |
<!-- END_IF --> | |
</td> | |
<td class="entryFormFileControl"> | |
<table class="entryFormMapTable"> | |
<tr> | |
<th><label for="unit-yolp-lat-{id}"> | |
緯度 | |
</label></th> | |
<td> | |
<!-- BEGIN_IF [{mapLat}/nem] --> | |
<input type="text" name="mapLat" value="{mapLat}" size="9" class="acms-admin-form-width-mini js-map_editable-lat"> | |
<!-- ELSE --> | |
<input type="text" name="mapLat" value="35.185574" size="9" class="acms-admin-form-width-mini js-map_editable-lat"> | |
<!-- END_IF --> | |
<input type="hidden" name="field[]" value="mapLat" /> | |
</td> | |
</tr> | |
<tr> | |
<th><label for="unit-yolp-lng-{id}"> | |
経度 | |
</label></th> | |
<td> | |
<!-- BEGIN_IF [{mapLng}/nem] --> | |
<input type="text" name="mapLng" value="{mapLng}" size="10" class="acms-admin-form-width-mini js-map_editable-lng"> | |
<!-- ELSE --> | |
<input type="text" name="mapLng" value="136.899066" size="10" class="acms-admin-form-width-mini js-map_editable-lng"> | |
<!-- END_IF --> | |
<input type="hidden" name="field[]" value="mapLng" /> | |
</td> | |
</tr> | |
<tr> | |
<th><label for="unit-yolp-zoom-{id}"> | |
ズーム | |
</label></th> | |
<td> | |
<!-- BEGIN_IF [{mapZoom}/nem] --> | |
<input type="text" name="mapZoom" value="{mapZoom}" size="2" class="acms-admin-form-width-mini js-map_editable-zoom"> | |
<!-- ELSE --> | |
<input type="text" name="mapZoom" value="10" size="2" class="acms-admin-form-width-mini js-map_editable-zoom"> | |
<!-- END_IF --> | |
<input type="hidden" name="field[]" value="mapZoom" /> | |
</td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
</table> | |
<script> | |
ACMS.Ready(function () { | |
ACMS.Library.yahooLoadProxy({ | |
'callback': function () { | |
$('.js-yahoo-map').each(function () { | |
ACMS.Dispatch.Edit.yolp($(this).get(0)); | |
}); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2.5系の場合のscript